This is a cache for elastic index stats; a layer between an index and retrieval. The statistics (such as document and term frequencies) are first read from the index and stay in the memory for further usages.
- Only one instance of Elastic cache needs to be created.
- If running out of memory, you need to create a new object of ElasticCache.
- The class also caches termvectors. To further boost efficiency, you can load term vectors for multiple documents using
Returns average length of a field in the collection.
Returns length of field in the collection.
coll_term_freq(term, field, tv=None)¶
Returns collection term frequency for the given field.
Returns number of documents with at least one term for the given field.
doc_freq(term, field, tv=None)¶
Returns document frequency for the given term and field.
Returns length of a field in a document.
multi_termvector(doc_ids, field, batch=50)¶
Returns term vectors for a given document and field.
Returns the number of documents in the index.
Returns number of fields in the index.
term_freq(doc_id, field, term)¶
Returns frequency of a term in a given document and field.
term_freqs(doc_id, field, tv=None)¶
Returns term frequencies for a given document and field.