[Xapian-discuss] doc.add_posting vs TermGenerator().index_text

mark markkicks at gmail.com
Sat Aug 16 16:10:54 BST 2008


is there any difference between using document.add_posting (in which
term is added one by one)
and TermGenerator().index_text for creating the xapian database?

does TermGenerator also take into account the position of terms added?
which method is faster?

or are they both the same?
thanks a lot!!!




indexer = xapian.TermGenerator()
indexer.set_document(doc)
indexer.index_text(text)

VS


WORD_RE = re.compile(r"\\w{1,32}", re.U)
for index, term in enumerate(WORD_RE.finditer(text)):
    doc.add_posting(stemmer.stem_word(term.group()), index)



More information about the Xapian-discuss mailing list