def addTermNarrower(self, tagSubjectList, termNarrower): if not index.exists_in(utils.indexerDir(), utils.indexName): self.createNewIndex() for tagSubject in tagSubjectList: self.__writer.add_document(tagSubject=unicode(tagSubject), termNarrower=unicode(termNarrower)) self.addToWordList(termNarrower)
def __init__(self): if not index.exists_in(utils.indexerDir(), utils.indexName): return self.ix = open_dir(utils.indexerDir(), indexname=utils.indexName)
def addTagScopeNote(self, tagSubject, tagScopeNote): if not index.exists_in(utils.indexerDir(), utils.indexName): self.createNewIndex() self.__writer.add_document(tagSubject=unicode(tagSubject), tagScopeNote=unicode(tagScopeNote)) self.addToWordList(tagScopeNote, 5)
def createNewIndex(self): ix = create_in(utils.indexerDir(), self.schema, indexname=utils.indexName) self.__writer = ix.writer()