OpenSearch 3.0 : unknown setting [index.knn.space_type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
C:\opensearch-3.0.0-windows-x64\opensearch-3.0.0

Describe the issue:
RAG chatbot with a conversational flow agent - OpenSearch Documentation <–On creation of Create a vector index specifying the ingest pipeline as a default pipeline.
curl -XPUT “http://localhost:9200/test_population_data” -H ‘Content-Type: application/json’ -d’
{
“mappings”: {
“properties”: {
“population_description”: {
“type”: “text”
},
“population_description_embedding”: {
“type”: “knn_vector”,
“dimension”: 384
}
}
},
“settings”: {
“index”: {
“knn.space_type”: “cosinesimil”,
“default_pipeline”: “test_population_data_pipeline”,
“knn”: “true”
}
}
}

It gives the below error
{
“error”: {
“root_cause”: [
{
“type”: “settings_exception”,
“reason”: “unknown setting [index.knn.space_type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings”
}
],
“type”: “settings_exception”,
“reason”: “unknown setting [index.knn.space_type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings”
},
“status”: 400
}

When I run below command, the plugin opensearch-knn is already present.
PS C:\opensearch-3.0.0-windows-x64\opensearch-3.0.0\bin> .\opensearch-plugin list
opensearch-alerting
opensearch-anomaly-detection
opensearch-asynchronous-search
opensearch-cross-cluster-replication
opensearch-custom-codecs
opensearch-flow-framework
opensearch-geospatial
opensearch-index-management
opensearch-job-scheduler
opensearch-knn
opensearch-ltr
opensearch-ml
opensearch-neural-search
opensearch-notifications
opensearch-notifications-core
opensearch-observability
opensearch-reports-scheduler
opensearch-security
opensearch-security-analytics
opensearch-skills
opensearch-sql
opensearch-system-templates
query-insights

How to fix the error?

@sans_india85 yes, that’s an expected behavior. You cannot specify the space_type using an index setting. We need to specify it in the index mapping like shown below:

“population_description_embedding”: {
“type”: “knn_vector”,
“dimension”: 384,
"space_type": "cosinesimil"
}

Thanks for your input.

https://localhost:9200/test_population_data

Mapper Parsing Exception as seen in the screenshot.


To resolve this, you can try removing the knn.space_type parameter. By default, knn_vector fields use the cosine similarity measure. Here is the corrected mapping:POST https://localhost:9200/test_population_data
{
“mappings”: {
“properties”: {
“population_description”: {
“type”: “text”
},
“population_description_embedding”: {
“type”: “knn_vector”,
“dimension”: 384
}
}
},
“settings”: {
“index”: {
“default_pipeline”: “test_population_data_pipeline”,
“knn”: true
}
}
}

@sans_india85 instead of space_type you are trying to use knn.space_type, that’s the reason you are running into mapper_parsing_exception. Check the example I shared in my previous comment. Also, the default value of space_type is l2 not cosinesimil.