now.executor.indexer.elastic.elastic_indexer module#

class now.executor.indexer.elastic.elastic_indexer.ElasticIndexer(dims, hosts='https://elastic:elastic@localhost:9200', es_config=None, metric='cosine', index_name='now-index', traversal_paths='@r', **kwargs)[source]#

Bases: now.executor.abstract.auth.auth.get_auth_executor_class.<locals>.NOWAuthExecutor

Initializer function for the ElasticIndexer.

Parameters
  • hosts (Union[str, List[Union[str, Mapping[str, Union[str, int]]]], None]) – host configuration of the Elasticsearch node or cluster

  • es_config (Optional[Dict[str, Any]]) – Elasticsearch cluster configuration object

  • metric (str) – The distance metric used for the vector index and vector search

  • dims (Union[List[int], int]) – The dimensions of your embeddings.

  • index_name (str) – ElasticSearch Index name used for the storage

  • es_mapping – Mapping for new index. If none is specified, this will be generated from metric and dims. Embeddings from chunk documents will always be stored in fields embedding_x where x iterates over the number of embedding fields (length of dims) to be created in the index.

  • traversal_paths (str) – Default traversal paths on docs (used for indexing, delete and update), e.g. ‘@r’, ‘@c’, ‘@r,c’.

index(**kwargs)#
search(**kwargs)#
update(**kwargs)#
list(**kwargs)#
delete(**kwargs)#