[Zope-CMF] Search results with portal_catalog - need a strategy
Tres Seaver
tseaver@zope.com
21 Jun 2003 10:34:48 -0400
On Fri, 2003-06-20 at 19:39, Peter McMillan wrote:
> I have what should be a simple objective. I'd like to search on the indexes
> of Title, Description and Summary. I have 191 documents in the site.
>
> When I search, I'm returning all 191 documents. I should be getting a
> smaller search result. If someone could give some pointers, I'd appreciate
> it.
>
> I'm using the stock search facilities within the Portal (Zope 2.5.1/CMF1.4).
>
> My indexes:
> Date FieldIndex
> Description KeywordIndex
> Subject KeywordIndex
> Title KeywordIndex
> Type FieldIndex
> Bobobase_modification_time FieldIndex
> Id FieldIndex
> Meta_type FieldIndex
>
You probably want a ZCTextIndex on 'Title' and 'Description':
KeywordIndex is really only useful for searching specific values (like
FieldIndex), where the method / attribute being indexed returns / is a
sequence of values: 'Subject' is the canonical example for this type of
index. Your 'Date' index is likely not to be as useful as you might
think: 'Date' actually returns a string. You might consider adding
a DateIndex on 'modified' and / or 'created'.
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com