Method: Langchain::Vectorsearch::Milvus#create_default_index

Defined in:
lib/langchain/vectorsearch/milvus.rb

#create_default_indexBoolean

Create the default index

Returns:

  • (Boolean)

    The response from the server



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/langchain/vectorsearch/milvus.rb', line 84

def create_default_index
  client.indexes.create(
    collection_name: index_name,
    index_params: [
      {
        metricType: "L2",
        fieldName: "vector",
        indexName: "vector_idx",
        indexConfig: {
          index_type: "AUTOINDEX"
        }
      }
    ]
  )
end