[Grok-dev] Problems searching with the Catalog

Alexandre Garel alex.garel at tarentis.com
Mon Dec 12 20:29:49 UTC 2011


Le 12/12/2011 19:55, Àlex Magaz Graça a écrit :
> Hi,
>
> I'm having some problems searching.
>
> The following fails, I guess, because "and" must be some kind of a 
> keyword for searchResults() or something:
>
> catalog = getUtility(ICatalog)
> catalog.searchResults(textattr="foo and")
>
> where textattr = grok.index.Text(). Is there some way to avoid this?

Did you try 'foo "and"' ?


>
> How do I match two non-consecutive values in an Field index? For 
> example, objects which have 1 or 4 as a value in a given attribute.
If you want to do this I think you'd better go with a Keyword index, 
with FieldIndex you shall be able to ask for a range eg (1,4) for 1, 2, 3, 4

> It would help a lot if someone could point me to the API documentation 
> of the catalog, I can't find it...

You may look at zope/index/field/README.txt or 
zope/index/text/textindex.txt even if its  low-level documentation

Hope it helps,

Alex


-- 
Alexandre Garel
06 78 33 15 37



More information about the Grok-dev mailing list