My company, a major US newspaper, are about to deploy a new online classified ad system built using Zope. ZCatalog queries are at the core of the system's functionality, and I am very happy with the status of our system's search abilities using a globbing vocabulary. My concern is that not all users are "power searchers" -- in fact, most will be using the default search box on the site's front page and not even know that they can do wildcard searches. A search of one day's worth of classified ads for "engineer" brings up 40 results; a search for "engineer OR engineers" brings up 49 items; a search for "engineer OR engineers OR engineering" brings up 79 items; a search for "engineer*" brings up 83. I guess what I am wondering is if there is a way to search with sub-words without explicit use of wildcards? That is to say, provide a default option (perhaps something that could be disabled with a simple checkbox in the quick search form) that automatically searches using sub-words, so that a search for engineer was actually rewritten as a search for "engineer*" instead. I suppose that one could rewrite REQUEST['nameOfIndexToBeSearched'] prior to <dtml-in Catalog> to achieve those results, but I am wondering if there might be a simpler solution? Thoughts? Sean ========================= Sean Upton Senior Programmer/Analyst SignOnSanDiego.com The San Diego Union-Tribune 619.718.5241 sean.upton@uniontrib.com =========================
sean.upton@uniontrib.com writes:
.... I guess what I am wondering is if there is a way to search with sub-words without explicit use of wildcards? That is to say, provide a default option (perhaps something that could be disabled with a simple checkbox in the quick search form) that automatically searches using sub-words, so that a search for engineer was actually rewritten as a search for "engineer*" instead. I suppose that one could rewrite REQUEST['nameOfIndexToBeSearched'] prior to <dtml-in Catalog> to achieve those results, but I am wondering if there might be a simpler solution? With Zope 2.4's pluggable indexes, you may have a special index that can do sub-word searches automatically.
With Zope 2.3, I fear you need to rewrite the subquery. I would steal the "UnTextIndex"'s parsing code to find the words and add '*' as necessary. Dieter
participants (3)
-
Dieter Maurer -
marc lindahl -
sean.upton@uniontrib.com