This construct seems to work: <dtml-in "portal_catalog.searchResults( {'meta_type' : 'News Item' ,'Subject': 's1' ,'Subject': 's2'' ,'Subject': 's3' ,'Subject': 's4'} , sort_on='Date' , sort_order='reverse' , review_state='published' )" size="10"> seems to return something that has Subject keywords s1 AND s2 AND s3 AND s4 (and in this example, meta_type=='News Item') -- unless I'm not testing it correctly! Feedback?
marc lindahl wrote:
This construct seems to work:
<dtml-in "portal_catalog.searchResults( {'meta_type' : 'News Item' ,'Subject': 's1' ,'Subject': 's2'' ,'Subject': 's3' ,'Subject': 's4'} , sort_on='Date' , sort_order='reverse' , review_state='published' )" size="10">
seems to return something that has Subject keywords s1 AND s2 AND s3 AND s4 (and in this example, meta_type=='News Item') -- unless I'm not testing it correctly!
I don't think you're testing thsi correctly. This is one of the things I'm really looking forward to in Zope 2.4 cheers, Chris
From: Chris Withers <chrisw@nipltd.com>
I don't think you're testing thsi correctly. This is one of the things I'm really looking forward to in Zope 2.4
Came up with something to fit my situation: <dtml-in "portal_catalog.searchResults( {'meta_type' : 'Portal Audio' ,'Subject': 's1'} , sort_on='Date' , sort_order='reverse' , review_state='published' )" size="10"> <dtml-if "list1inlist2(['s2','s3','s4'],Subject)"> <blah blah, put the stuff to display each list element here> where list1inlist2.pys looks like: #returns true if ALL elements of list1 are in list2 for l1 in list1: if l1 not in list2: return 0 return 1 So, the first search gives an overbroad list, but at least not the entire catalog... then I just chuck anything in there that doesn't meet the more restricted requirements.
--On 05/19/01 16:36:57 -0400 marc lindahl chiseled:
This construct seems to work:
<dtml-in "portal_catalog.searchResults( {'meta_type' : 'News Item' ,'Subject': 's1' ,'Subject': 's2'' ,'Subject': 's3' ,'Subject': 's4'} , sort_on='Date' , sort_order='reverse' , review_state='published' )" size="10">
implicit anding for text indexes has been part of the catalog since 2.3.1, i think: http://www.zope.org/SiteIndex/search/view_source basically, add textindex_operator='and' to your searchResults keywords... -- -mindlace- zopatista community liason
Actually I was wrong :( It OR's the subjects in the following.... subject is a keyword index, if that has anything to do with it.
From: ethan mindlace fremen <mindlace@digicool.com> Date: Sun, 03 Jun 2001 11:39:12 -0400 To: zope@zope.org Subject: Re: [Zope] searching keywords with AND
--On 05/19/01 16:36:57 -0400 marc lindahl chiseled:
This construct seems to work:
<dtml-in "portal_catalog.searchResults( {'meta_type' : 'News Item' ,'Subject': 's1' ,'Subject': 's2'' ,'Subject': 's3' ,'Subject': 's4'} , sort_on='Date' , sort_order='reverse' , review_state='published' )" size="10">
implicit anding for text indexes has been part of the catalog since 2.3.1, i think:
http://www.zope.org/SiteIndex/search/view_source
basically, add textindex_operator='and' to your searchResults keywords... -- -mindlace- zopatista community liason
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Chris Withers -
ethan mindlace fremen -
marc lindahl