Commit 0d93f320 authored by Jeremy Hylton's avatar Jeremy Hylton

Make sure stop words are used with old TextIndex.

I think that the default Lexicon for TextIndex does not use a stop
word list.  For the comparison with ZCTextIndex, explicitly pass the
default stop word dict from TextIndex to the lexicon.
parent 8915733b
...@@ -33,7 +33,11 @@ def make_zc_index(): ...@@ -33,7 +33,11 @@ def make_zc_index():
return ZCTextIndex("read", extra, caller) return ZCTextIndex("read", extra, caller)
def make_old_index(): def make_old_index():
return TextIndex("read") from Products.PluginIndexes.TextIndex.TextIndex import TextIndex
from Products.PluginIndexes.TextIndex.Lexicon \
import Lexicon, stop_word_dict
return TextIndex("read", lexicon=Lexicon(stop_word_dict))
def main(db, root, dir): def main(db, root, dir):
rt["index"] = index = INDEX() rt["index"] = index = INDEX()
...@@ -115,7 +119,6 @@ if __name__ == "__main__": ...@@ -115,7 +119,6 @@ if __name__ == "__main__":
if o == '-n': if o == '-n':
LIMIT = int(v) LIMIT = int(v)
if o == '-T': if o == '-T':
from Products.PluginIndexes.TextIndex.TextIndex import TextIndex
INDEX = make_old_index INDEX = make_old_index
if len(args) != 1: if len(args) != 1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment