[Xapian-devel] Fetching document content by Q term in Python

Alec Thomas xapian-devel-list at swapoff.org
Fri Feb 9 00:18:10 GMT 2007


I'd like to be able to retrieve the indexes stored copy of the document
text and tried the following:

    terms = self.db.allterms()
    terms.skip_to('Q' + uri.encode('utf-8'))
    term = terms.next()
    doc = self.db.get_document(term[1])
    print doc.get_data()

I just wildly guessed that [1] was the docid, but of course it isn't. So the
question is, how do I get a docid out of a term?

Or if I'm completely on the wrong track, how do I get the document from
a Q term?


More information about the Xapian-devel mailing list