[Zope] Howto search multiple fields of ZCatalog

Michael michael@nichestaffing.com
Fri, 22 Nov 2002 10:00:21 -0700


Are you using ZClasses?  if so, you can write a short script catting the 
fields together and place it in your Extensions directory calling it 
something like Keyword_Search.py. :

def getSearchSource(self):
	return self.field_one+"\n"+self.field_two+"\n"+self.field_three

Then create an external method in your ZClass called getSearchSource.
Now you can create a text index in your Catalog called Keyword_Search, and 
that should do it.

Check out the tutorial at 
http://www.zope.org/Members/kusako/AdvancedCataloging

Michael



Michael

On Friday 22 November 2002 12:51 am, Ralph vd Houdt wrote:
> Hi all,
>
> I'm trying to create a search in a ZCatalog in wich I can give a single
> search string, for example "this AND that" that will search in 2 or more
> combined fields.
>
> If both (or more) values are available in the combined text of the fields
> than there should be a match, for example when "this" is in the title and
> "that" is in the description the object has to be in the result set.
>
> Is there any solution to this problem?
>
> Greetings Ralph
>
>
> _______________________________________________
> 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 )

-- 
Michael Lewis
Nichestaffing.com
Web: http://www.nichestaffing.com
Email: mlewis@nichestaffing.com
Phone: 970-472-1241
Fax: 970-472-8497

"Whatever you can conceive and believe, you can achieve"