I have successfully upgraded the cluster directly from OpenDistro 1.12 to OpenSearch 1.0.0 with Rolling Upgrade. Cluster and indices are green.
All my indices are kNN, and after upgrade I can’t search with them. Right now I have next error:
{'error': {'root_cause': [{'type': 'illegal_argument_exception', 'reason': '[KNN] Invalid engine type: null'}], 'type': 'search_phase_execution_exception', 'reason': 'all shards failed', 'phase': 'query', 'grouped': True
After researching the documentation ([Approximate search - OpenSearch documentation](Template for kNN indice)), it became clear that OpenSearch has new parameters for kNN indexes. I tried to update mapping for indices and add parameters
"name": "hnsw",
"engine": "nmslib",
So, I’ve sent next PUT-request:
{
"properties": {
"my_vector":{
"type": "knn_vector",
"dimension": 512,
"method": {
"name": "hnsw",
"space_type": "l2",
"engine": "nmslib",
"parameters": {
"ef_construction": 1024,
"m": 16
}
}
}
}
}
and get next answer:
{
"error": {
"root_cause": [
{
"type": "null_pointer_exception",
"reason": "Cannot invoke \"org.opensearch.knn.index.KNNMethodContext.getMethodComponent()\" because \"m\" is null"
}
],
"type": "null_pointer_exception",
"reason": "Cannot invoke \"org.opensearch.knn.index.KNNMethodContext.getMethodComponent()\" because \"m\" is null"
},
"status": 500
}
but if i change “my_vector” to “my_vector3”, everything wil be OK:
{
"properties": {
"my_vector3":{
"type": "knn_vector",
"dimension": 512,
"method": {
"name": "hnsw",
"space_type": "l2",
"engine": "nmslib",
"parameters": {
"ef_construction": 1024,
"m": 16
}
}
}
}
}
{
"acknowledged": true
}
Here is my setup for indece:
{
"index_data_m16_ef1024": {
"aliases": {},
"mappings": {
"_source": {
"excludes": [
"my_vector"
]
},
"properties": {
"cam_id": {
"type": "integer"
},
"detect_id": {
"type": "long"
},
"my_vector": {
"type": "knn_vector",
"dimension": 512
},
"my_vector2": {
"type": "knn_vector",
"dimension": 512,
"method": {
"engine": "nmslib",
"space_type": "cosinesimil",
"name": "hnsw",
"parameters": {
"ef_construction": 1024,
"m": 16
}
}
},
"time_check": {
"type": "date",
"store": true,
"format": "yyyy-MM-dd HH:mm:ss"
}
}
},
"settings": {
"index": {
"refresh_interval": "-1",
"translog": {
"flush_threshold_size": "10gb"
},
"knn.algo_param": {
"ef_search": "1024",
"ef_construction": "1024",
"m": "16"
},
"blocks": {
"write": "true"
},
"provided_name": "index_data_m16_ef1024",
"max_result_window": "1000000",
"knn": "true",
"creation_date": "1678200300301",
"unassigned": {
"node_left": {
"delayed_timeout": "240m"
}
},
"number_of_replicas": "1",
"uuid": "ir0INjAxSGKv_1Gd7VEiQA",
"version": {
"created": "7100099",
"upgraded": "7100099"
},
"routing": {
"allocation": {
"initial_recovery": {
"_id": null
}
}
},
"number_of_shards": "15",
"routing_partition_size": "1",
"knn.space_type": "cosinesimil",
"resize": {
"source": {
"name": "index_data_m16_ef1024",
"uuid": "Bz3uUXjUQU60erWW4SgoMg"
}
}
}
}
}
}
What shall I do in this situation?
P.S: I have TB of indices, so there is no way to create new cluster or reindex indices