[Zope] Problem : ZCatalog (plain-text email this time)
Dieter Maurer
dieter@handshake.de
Fri, 26 Jan 2001 20:51:33 +0100 (CET)
Fabien Germain writes:
> I have a ZCatalog with lots of entries. I added the index "absolute_url" in
> order to search by the files url.
>
> Why ?
> 'cause I have files in organized folders like that :
> ........./language_name/country_name/city_name/element
>
> I'd like to do a search on "#language_name and #country_name and #city_name"
> in my catalog, so I use the absolute_url.
> But the problem is that the search only looks the end of the absolute_url
> string, that's to say "element" in my exemple.
It is strange that you apparently see it looking at the end
as
Splitter("abcd/bcde/cdef") = ["abcd/bcde/cdef"]
i.e. it should only look at the complete URL.
Probably, you should not use a textindex for your purpose,
as it does not split at '/'.
You should go for a keyword index. It expects a sequence
of keywords rather than a string.
Thus, you should replace "absolute_url" by "getPhysicalPath".
This will probably work nice, unless you use virtual hosts.
Dieter