[Zope-dev] (Z)Catalog searches

Casey Duncan cduncan@kaivo.com
Thu, 15 Mar 2001 08:30:28 -0700


richard@bizarsoftware.com.au wrote:
> 
> We're using the internals of ZCatalog to do searching stuff in our Python
> Product. I've managed to get it working at a basic level by constructing a
> Catalog instance and adding indexes and calling searchResults(). Only now I
> need to get into more advanced features, like partial word matches and
> multiple or'ed search fields.
> 
> I tried just passing a GlobbingLexicon() to Catalog instantiation, but that
> completely failed to work. As far as I can tell, it's not using the
> GlobbingLexicon at all (I put a print statements in all the methods and
> nothing is printed).
> 
> I then tried using ZCatalog.Vocabulary(globbing=1) and that didn't seem to
> work either (still no hits on the GlobbingLexicon methods).
> 
> Also, any hints as to how to have a "match any" multiple field "or" search
> would be greatly appreciated. I _think_ I can somehow pass a list of the
> fields to searchResults() as some sort of argument, but I'm really not sure
> how.
> 
>     Richard
> 
> --
> Richard Jones
> richard@bizarsoftware.com.au
> Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)
> 

Globbing support is part of the Vocabulary object which must be turned
on when it is instanciated AFAIK. Are you passing the Catalog an
existing Vocabulary when you create it or are you having it create one
for you?
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>