AW: AW: AW: [Zope] Searching the Catalog

Oleg Broytmann phd@mail2.phd.pp.ru
Wed, 21 Mar 2001 18:45:02 +0300 (MSK)


On Wed, 21 Mar 2001, Marc Fischer wrote:
> But now :-) How to avoid duplicate results ???

   There is no simple way :(

   You need to init a dictionary, run through the combined results and put
results into a dictionary, using URL as a key. Dictionary will
automatically cope with duplicate keys (URLs).

   But some duplicates still will be there. For example, a call to a Folder
(http://my.site/XYFolder/) will actually render its index_html. Now see:
the URL http://my.site/XYFolder/index_html is different... but the rendered
object is the same. So URL is not the best dictionary key. May be object's
absolute_url() or such.

   Anyway it is not simple and I recommend you to ignore dup results in
your OR searches. This makes the life (of programmer) much simpler :)

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.