[Zope] Pre-indexing filter and accented letters

Dieter Maurer dieter at handshake.de
Mon Jun 6 13:17:41 EDT 2005


Yuri wrote at 2005-6-6 11:56 +0200:
>I would like to index a text property of an object in the ZCatalog. The 
>text is in French language, but I have a problem: I have to find results 
>for the related non accented letters!
>
> I mean, If I do a search for  "actualite", the index should return also 
>the object which text contains "actualitè".

Implement a PythonScript that performs the normalization of
"context.SearchableText()", say "NormalizedSearchableText".

Ensure, it is acquirable by your indexed objects.

Index "NormalizedSearchableText" rather than "SearchableText"
and use this index for your searches.

Ensure, that you perform the same normalization on search
terms before you use them in a query.

By the way, "ManagableIndex" greatly facilitates the inclusion
of normalizers. However, it currently does not interface with
a "TextIndex" (only a "WordIndex").

  <http://www.dieter.handshake.de/pyprojects/zope>


-- 
Dieter


More information about the Zope mailing list