[Zope3-Users] Search multiple fields with TextIndex

Massimiliano della Rovere massimiliano.dellarovere at gmail.com
Fri Feb 13 12:03:04 EST 2009


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?


More information about the Zope3-users mailing list