now.executor.indexer.in_memory.in_memory_indexer module#

class now.executor.indexer.in_memory.in_memory_indexer.InMemoryIndexer(*args, **kwargs)[source]#

Bases: now.executor.abstract.base_indexer.base_indexer.NOWBaseIndexer

InMemoryIndexer indexes Documents into a DocumentArray with storage=’memory’

Parameters
  • dim – Dimensionality of vectors to index.

  • columns – List of tuples of the form (column_name, str_type). Here str_type must be a string that can be

parsed as a valid Python type. :param metric: Distance metric type. Can be ‘euclidean’, ‘inner_product’, or ‘cosine’ :param limit: Number of results to get for each query document in search :param traversal_paths: Default traversal paths on docs :param max_values_per_tag: Maximum number of values per tag (used for search), e.g. ‘@r’, ‘@c’, ‘@r,c’

construct(**kwargs)[source]#

Calls the constructor of the specialized indexer

batch_iterator()[source]#

Needs to be implemented in derived classes. Iterates over all documents in batches and yields them

convert_filter_syntax(search_filter={}, search_filter_not={})[source]#

Needs to be implemented in derived classes. Converts the filter syntax to the syntax of the specific indexer

index(docs, parameters, **kwargs)[source]#

Needs to be implemented in derived classes. Indexes the documents

delete(filtered_docs, *args, **kwargs)[source]#

Needs to be implemented in derived classes. Deletes the documents

search(docs, parameters, retrieval_limit, search_filter, **kwargs)[source]#

Needs to be implemented in derived classes. Searches the documents