MapSimIndex
See MemorySimIndex for sample usage
Inherits from pysimsearch.sim_index.SimIndex.
Simple implementation of the SimIndex interface backed with dict-like objects (MutableMapping). By default, uses dict, in which case the indexes are in-memory.
NOTE: to ensure proper compatibility with arbitrary dict-like objects, including persistent shelves, any mutations must be done using assignment. E.g., do not do:
map[key].extend([a, b])
Instead, do the equivalent of:
map[key] += [a,b] # same as: map[key] = map[key].__iadd__([a,b])
Returns a list of docids of docs containing all terms
Returns an iterable of docnames containing terms
Return local number of documents
Build a similarity index over files given by filenames
Convenience method that wraps index_files()
Build a similarity index over collection given in named_files named_files is a list iterable of (filename, file) pairs
Adds string buffers to the index.
Returns list of (docid, freq) tuples for documents containing term
Finds documents similar to query_vec
Finds documents similar to query_string.
Convenience method that calls self.query()
Set global number of documents
Set the query_scorer