|
Static methods defined here:
- close()
- Close the open index.
- getAttribute(attributeName, docid)
- Get an attribute for a document, or None.
attributeName: Name of a document attribute.
docid: An internal document id (an integer).
- getDocCount(fieldName)
- Get the number of documents that contain a specified field.
fieldName: The name of a document field.
- getDocFreq(fieldName, term)
- Get the document frequency (df) of a term in a field (e.g.,
the number of documents that contain 'apple' in title fields).
fieldName: The name of a document field.
term: A lexically-processed term that may appear in the corpus.
- getExternalDocid(iid)
- Get the external document id for a document specified by an
internal document id.
iid: An internal document id (an integer).
- getFieldLength(fieldName, docid)
- Get the length of a field in a document. The length includes stopwords.
fieldName: The name of a document field.
docid: An internal document id (an integer).
- getFields()
- Get a list of document fields supported by this index.
- getInternalDocid(docid)
- Get the internal document id for a document specified by its
external id, e.g. clueweb09-enwp00-88-09710.
docid: An external document id (a string).
- getNumDocs()
- Get the total number of documents in the corpus.
- getSumOfFieldLengths(fieldName)
- Get the total number of term occurrences contained in all
instances of the specified field in the corpus (e.g., add up
the lengths of every TITLE field in the corpus).
fieldName: The name of a document field.
Returns the total number of term occurrences.
- getTermVector(docid, fieldName)
- Return an Indri DocVector-style interface to the Lucene
termvector for a field in a document.
docid: An internal document id.
fieldName: The name of a document field.
A (Java) TermVector object is returned. The TermVector supports the following methods.
- indexOfStem(stem)
- Get the index of stem in the stems vector, or -1 if the stems
vector does not contain the stem.
- positionsLength()
- Get the number of positions in this field (the length of the
field). If positions are not stored, return 0.
Note: Idx.getFieldLength report a longer length if the field
ends with stopwords.
- stemAt(i)
- Get the index of the stem that occurred at position i in
the document.
- stemDf(i)
- Returns the df of the i'th stem.
- stemFreq(i)
- Get the frequency (tf) of the i'th stem in the current doc,
or -1 if the index is invalid. The frequency for stopwords
(i=0) is not stored (0 is returned).
- stemsLength
- The number of unique stems in this field.
- stemString(i)
- Get the string for the i'th stem, or None if the index
is invalid.
- totalStemFreq(i)
- Returns ctf of the i'th stem.
- getTotalTermFreq(fieldName, term)
- Get the collection term frequency (ctf) of a term in
a field (e.g., the total number of times the term 'apple'
occurs in title fields.
fieldName: The name of a document field.
term: A lexically-processed term that may appear in the corpus.
Returns the total number of term occurrence.
- open(index_path, Idxpycache=True)
- Open a Lucene index.
indexPath: A path to a directory that contains a Lucene index.
Idxpycache: Iff True, Idx.pycache.xxx files are used, if available.
Returns True if the index was opened, otherwise returns False.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- LeafContextCache = <class 'Idx.Idx.LeafContextCache'>
- IndexReader LeafContexts are cached to reduce index calls to
jnius. Some retrieval models access LeafContexts often when
looking up basic statistics, which is computationally expensive.
The cache stores the LeafContexts and commonly accessed attributes
and values.
- indexReader = None
|