This module contains classes that allow reading from an index.
Do not instantiate this object directly. Instead use Index.reader().
Returns a PostingReader for the postings of the given term.
>>> pr = searcher.postings("content", "render")
>>> pr.skip_to(10)
>>> pr.id
12
Parameters: |
|
---|---|
Exclude_docs: | an optional BitVector of documents to exclude from the results, or None to not exclude any documents. |
Return type: |
Returns a PostingReader object for the given term vector.
>>> docnum = searcher.document_number(path=u'/a/b/c')
>>> v = searcher.vector(docnum, "content")
>>> v.all_as("frequency")
[(u"apple", 3), (u"bear", 2), (u"cab", 2)]
Parameters: |
|
---|---|
Return type: |
Returns an iterator of (termtext, value) pairs for the terms in the given term vector. This is a convenient shortcut to calling vector() and using the PostingReader object when all you want are the terms and/or values.
>>> docnum = searcher.document_number(path=u'/a/b/c')
>>> searcher.vector_as("frequency", docnum, "content")
[(u"apple", 3), (u"bear", 2), (u"cab", 2)]
Parameters: |
|
---|