[Zope3-Users] Search multiple fields with TextIndex

Shailesh Kumar shaileshk at gmail.com
Fri Feb 13 13:00:34 EST 2009


please have a look at AttributeIndex mixin.
http://apidoc.zope.org/++apidoc++/Book/indexcatalog/catalog/show.html

Having 3 different Attribute Indices might be a better idea than 3 different
Text Indices.


With regards,
- Shailesh


On Fri, Feb 13, 2009 at 10:33 PM, Massimiliano della Rovere <
massimiliano.dellarovere at gmail.com> wrote:

> Suppose I have an object with the following interface:
> IArtFile
> author: TextLine...
> subject: Textline...
> location: TextLine...
>
> I setup 3 text indices and create 3 adapters implementing
> ISearchableText to extract each field.
>
> I want  to create a search viewlet or page with a <form> section containing
> [search field author, name & id = author]
> [search field subject, name & id = subject]
> [search field TextLine, name & id = subect]
> I thought about using a class derived from BaseForm or something like
> that to use the practical Fields(IArtFile). What is the best class to
> derive from?
>
> Then I have somehow to instruct the ICatalog Utility to combine the
> result from the indicies, I mean
> if subject is "David" and author "Michelangelo" and location
> "Firenze", I want all the istances implementing IArtFile having these
> text lines in their attributes.
> I was thinking about converting the list returned by each
> catalog.apply function into set and then calculating the intersect
> function.
> Is there a better way to do it?
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20090213/66c7900b/attachment.html 


More information about the Zope3-users mailing list