AW: [Zope] Searching catalog via substring

Reineke reineke@kreiskrankenhaus-hameln.de
Tue, 16 Jul 2002 10:55:51 +0200


Hi,

> > When the user types
> > in such a complex query automatically pre- and appending '*' will
> > give unexpected results.
>=20
> But how do I do that?
>=20
> I want it for the users as least complex as possible, cause they don't
> know anything about regexps or anything.

now I got it. Puh.

Added a Python Script globSearchString:

""" Globs searchstring 'string' to '*string*' """
return context.catalog(
         {'title' : '*' + title + '*' }
        )

Altered the searchform:
<input name=3D"begriff" width=3D30 value=3D"">

And the report method:
<dtml-in expr=3D"globSearchString(begriff)" size=3D5 =
start=3Dquery_start>

And it works.

Thanks anyway for your help.

Lars