Commit 9319c8e0 authored by Guido van Rossum's avatar Guido van Rossum

Rename the Index classes to OkapiIndex and CosineIndex, respectively.

parent 025db164
...@@ -27,7 +27,7 @@ from Products.PluginIndexes.common.PluggableIndex \ ...@@ -27,7 +27,7 @@ from Products.PluginIndexes.common.PluggableIndex \
import PluggableIndexInterface import PluggableIndexInterface
from Products.PluginIndexes.common.util import parseIndexRequest from Products.PluginIndexes.common.util import parseIndexRequest
from Products.ZCTextIndex.OkapiIndex import Index from Products.ZCTextIndex.OkapiIndex import OkapiIndex
from Products.ZCTextIndex.ILexicon import ILexicon from Products.ZCTextIndex.ILexicon import ILexicon
from Products.ZCTextIndex.Lexicon \ from Products.ZCTextIndex.Lexicon \
import Lexicon, Splitter, CaseNormalizer, StopWordRemover import Lexicon, Splitter, CaseNormalizer, StopWordRemover
...@@ -47,7 +47,7 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem): ...@@ -47,7 +47,7 @@ class ZCTextIndex(Persistent, Acquisition.Implicit, SimpleItem):
query_options = ['query'] query_options = ['query']
def __init__(self, id, extra, caller, index_factory=Index): def __init__(self, id, extra, caller, index_factory=OkapiIndex):
self.id = id self.id = id
self._fieldname = extra.doc_attr self._fieldname = extra.doc_attr
lexicon = getattr(caller, extra.lexicon_id, None) lexicon = getattr(caller, extra.lexicon_id, None)
......
...@@ -22,7 +22,7 @@ from BTrees.IOBTree import IOBTree ...@@ -22,7 +22,7 @@ from BTrees.IOBTree import IOBTree
from BTrees.OIBTree import OIBTree from BTrees.OIBTree import OIBTree
from Products.ZCTextIndex.NBest import NBest from Products.ZCTextIndex.NBest import NBest
from Products.ZCTextIndex.OkapiIndex import OkapiIndex as Index from Products.ZCTextIndex.OkapiIndex import OkapiIndex
from Products.ZCTextIndex.Lexicon import Lexicon, Splitter from Products.ZCTextIndex.Lexicon import Lexicon, Splitter
from Products.ZCTextIndex.Lexicon import CaseNormalizer, StopWordRemover from Products.ZCTextIndex.Lexicon import CaseNormalizer, StopWordRemover
from Products.ZCTextIndex.QueryParser import QueryParser from Products.ZCTextIndex.QueryParser import QueryParser
...@@ -382,7 +382,7 @@ class TextIndex(Persistent): ...@@ -382,7 +382,7 @@ class TextIndex(Persistent):
def __init__(self): def __init__(self):
self.lexicon = Lexicon(Splitter(), CaseNormalizer(), StopWordRemover()) self.lexicon = Lexicon(Splitter(), CaseNormalizer(), StopWordRemover())
self.index = Index(self.lexicon) self.index = OkapiIndex(self.lexicon)
def index_text(self, docid, text): def index_text(self, docid, text):
self.index.index_doc(docid, text) self.index.index_doc(docid, text)
......
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