Files
nosqlbench/adapter-milvus/src/main/resources/milvus.md
Madhavan Sridharan 82eef18d5a Initial skeleton draft
2024-03-15 13:35:02 -04:00

4.4 KiB

milvus driver adapter

The milvus driver adapter is a nb adapter for the milvus driver, an open source Java driver for connecting to and performing operations on an instance of a Milvus/Zilliz Vector database. The driver is hosted on github at https://github.com/milvus-io/milvus-sdk-java

activity parameters

The following parameters must be supplied to the adapter at runtime in order to successfully connect to an instance of the Milvus/Zilliz database:

  • token - In order to use the pinecone database you must have an account. Once the account is created you can request an api key. This key will need to be provided any time a database connection is desired.
  • uri - When an Index is created in the database the uri must be specified as well. The adapter will use the default value of localhost:19530 if none is provided at runtime.

Op Templates

The Milvus adapter supports all operations supported by the Java driver published by Milvus. The official Milvus API reference can be found at https://docs.pinecone.io/reference/describe_index_stats_post

The operations include:

  • Delete
  • DescribeIndexStats
  • Fetch
  • Query
  • Update
  • Upsert

Examples

ops:
  # A pinecone query op
  query-example:
    type: query
    index: query_index
    # The query vector. Use these fields if only querying a single vector. If querying multiple use the
    # query_vectors structure below.
    vector: my_array_of_floats
    namespace: query_namespace
    # The number of results to return for each query.
    top_k: int_query_topk
    # You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/
    filter:
      filterfield: metadata_field
      operator: [$lt, $eq, $gt, ...]
      comparator: value
    # Indicates whether vector values are included in the response.
    include_values: boolean
    # Indicates whether metadata is included in the response as well as the ids.
    include_metadata: boolean
    query_vectors:
      - id: 1
        values: csv_separated_floats
        top_k: int_val
        namespace: string_val
        filter:
          filterfield: metadata_field
          operator: [$lt, $eq, $gt, ...]
          comparator: value
        sparse_values:
          indices: list_of_ints
          values: list_of_floats
      - id: 2
        values: csv_separated_floats
        top_k: int_val
        namespace: string_val
        filter:
          filterfield: metadata_field
          operator: [$lt, $eq, $gt, ...]
          comparator: value
        sparse_values:
          indices: list_of_ints
          values: list_of_floats

# A delete op
# If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
# with specifying ids to delete in the ids param or using delete_all=True. delete_all indicates that all vectors
# in the index namespace should be deleted.
  delete-example:
    type: delete
    index: delete_index
    namespace: delete_namespace
    ids: csv_list_of_vectors_to_delete
    deleteall: [true,false]
    filter:
      filterfield: metadata_field
      operator: [$lt, $eq, $gt, ...]
      comparator: value

# A describe index stats op. Specify metadata filters to narrow the range of indices described.
  describe-index-stats-example:
    type: describe-index-stats
    index: describe_index
    filter:
      filterfield: metadata_field
      operator: [$lt, $eq, $gt, ...]
      comparator: value

# A pinecone fetch op
  fetch-example:
    fetch: fetch_index
    namespace: fetch_namespace
    ids: csv_list_of_vectors_to_fetch

# A pinecone update op
  update-example:
    type: update
    index: update_index
    id: string_id
    values: list_of_floats
    namespace: update_namespace
    metadata:
      key1: val1
      key2: val2
      key3: val3
    sparse_values:
      indices: list_of_ints
      values: list_of_floats

# A pinecone upsert op
  upsert-example:
    type: upsert
    index: upsert_index
    namespace: upsert_namespace
    upsert_vectors:
      - id: 1
        values: csv_separated_floats
        sparse_values:
          indices: list_of_ints
          values: list_of_floats
        metadata:
          key1: val1
          key2: val2
      - id: 2
        values: csv_separated_floats
        sparse_values:
          indices: list_of_ints
          values: list_of_floats