1. Matt Chaput
  2. whoosh
  3. Issues
Issue #156 resolved

[with patch] Highlighting fails for MultiFilter()

created an issue

Hi, I'm using MultiFilter for revision name indexing.

{{{ iwf = MultiFilter(index=IntraWordFilter(mergewords=True, mergenums=True), query=IntraWordFilter(mergewords=False, mergenums=False) ) }}}

And I want to highlights my search results, but highlight.py line 614

{{{ tokens = copyandmatchfilter(termset, analyzer(text, chars=True, keeporiginal=True)) }}}

don't check for "mode' parameter, so I can't use highlighting.

I added patch in attachment and hope what this helps.

Comments (3)

  1. Thomas Waldmann

    To make this bug more clear, what happens is this:

    it doesn't give mode='query' to analyser, so it defaults to mode=''.

    MF falls over this as it tries to use mode ('') as key (but it only has entries for keys 'query' and 'index').

    http://paste.pocoo.org/show/444240/ see there for a traceback.

    about the patch: please check whether it is needed to introduce a mode param, maybe just giving mode='query' could also fix it (do we need other mode values?).

  2. Log in to comment