[Zope] Ignore stopwords/characters in alphabetical results
feedreader at yahoo.com
Tue Feb 7 05:26:26 EST 2006
Thanks Dieter and others for helping me understand
In the end I added the following code to my product:
"""Returns a normalized copy of the title for
nt = ''
if hasattr(self, 'title'):
nt = re.sub('^A |^An |^The |\W', ' ',
nt = join(split(nt))
I then added a norm_title index to my ZCatalog for
sorting. I'm a regex newbie so any improvements are
--- Dieter Maurer <dieter at handshake.de> wrote:
> Ken Ara wrote at 2006-2-2 00:41 -0800:
> >I have been asked to improve the order of search
> >results, so that stop words and certain characters
> >the beginning of a title are ignored. "Final
> >"The Final Report" and "[Final] Report" all need to
> >appear under the letter 'F'.
> Thus, you only want the change the result order.
> Unless you want relevancy ranking (which is not the
> depending on your description), ordering has nothing
> do with the indexes (at least not the text indexes).
> Ordering can be done with "sequence.sort"
> (documented in
> the Zope Online help system) or with Python's "sort"
> In both cases, you can provide your own comparison
> The comparison faction to use the vocabulary to
> check for
> stopwords (words not known by the vocabulary are
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
More information about the Zope