# Getting error while trying to create knn index on elasticsearch version 8.7.1

**URL:** <https://discuss.elastic.co/t/getting-error-while-trying-to-create-knn-index-on-elasticsearch-version-8-7-1/342101>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [September 1, 2023, 8:38am UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-create-knn-index-on-elasticsearch-version-8-7-1/342101 "2023-09-01T08:38:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharad\_Nautiyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharad_nautiyal/32/123246_2.png) [@Sharad\_Nautiyal](https://discuss.elastic.co/u/Sharad_Nautiyal)\
**Post date:** [September 1, 2023, 8:38am UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-create-knn-index-on-elasticsearch-version-8-7-1/342101/1 "2023-09-01T08:38:02Z")

</div>

Below is the request I am sending while creating knn index:

```auto
PUT posting
{
  "settings": {
    "index": {
      "number_of_shards" :20,
      "number_of_replicas": 1,
      "knn":{
        "algo_param":{
          "ef_search":40,
          "ef_construction":40,
          "m": "4"
        }
      }
    },
    "knn": true
  }, 
  "mappings": {
    "properties": {
      "vector": {
        "type": "knn_vector",
        "dimension": 384
      }
    }
  }
}

```

Below is the error I am facing:-  
"reason": "unknown setting [index.knn.algo\_param.m] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

As per error it is saying plugin missing but if I go by the documentation knn is available on 8.0 version onwards. Kindly help on how to resolve this, if I need to install external plugin please share steps to do so.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 1, 2023, 8:46am UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-create-knn-index-on-elasticsearch-version-8-7-1/342101/2 "2023-09-01T08:46:18Z")

</div>

I do not see these parameters anywhere in the official Elasticsearch documentation. It does however, based on quick google search, seem like these parameters may be used in Opensearch. Where did you get these parameters from?

---

<div class="post-metadata">

**Author:** ![Serena\_Chou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/serena_chou/32/100087_2.png) [@Serena\_Chou](https://discuss.elastic.co/u/Serena_Chou)\
**Post date:** [September 1, 2023, 1:49pm UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-create-knn-index-on-elasticsearch-version-8-7-1/342101/4 "2023-09-01T13:49:48Z")

</div>

Hey there, please check how you've set the parameters. These documents might help to get you started [kNN search API | Elasticsearch Guide [8.9] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search-api.html)  
[k-nearest neighbor (kNN) search | Elasticsearch Guide [8.9] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html)

and we have a great repository of code that can help you to bootstrap this. Here are some notebooks you can use to try it out [https://github.com/elastic/elasticsearch-labs/tree/main/notebooks](https://github.com/elastic/elasticsearch-labs/tree/main/notebooks)

---

<div class="post-metadata">

**Author:** ![Sharad\_Nautiyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharad_nautiyal/32/123246_2.png) [@Sharad\_Nautiyal](https://discuss.elastic.co/u/Sharad_Nautiyal)\
**Post date:** [September 2, 2023, 6:06am UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-create-knn-index-on-elasticsearch-version-8-7-1/342101/5 "2023-09-02T06:06:28Z")

</div>

> [@Sharad\_Nautiyal](#):
>
> reaking changes documentation for removed settings

Hi Thanks for the response.  
@Christian_Dahlqvist I was trying to explore data vectorization and then performing semantic search on that data in elasticsearch using knn following note which is also referred by @Serena_Chou "[k-nearest neighbor (kNN) search | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html)" . Although the code shared above has type: knn\_vector which I was randomly trying.

@Serena_Chou thanks I followed the example mentioned in the git repo you have shared. In example "[https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/00-quick-start.ipynb](https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/00-quick-start.ipynb)" they have mentioned under column mappings type as dense\_vector as below:  
"title\_vector": {  
"type": "dense\_vector",  
"dims": 384,  
"index": "true",  
"similarity": "cosine"  
}  
If you refer to my installed elk setup on version 8.7.1 I don't see any data type as vector, screenshot from installation below:-  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/b/fb27c6808e34dc2700951a4fdc4166404378ec37.png)

Is this option only present on Elastic cloud version and not available in on-premise version. Please help to let me know.

---

<div class="post-metadata">

**Author:** ![joemcelroy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joemcelroy/32/103757_2.png) [@joemcelroy](https://discuss.elastic.co/u/joemcelroy)\
**Post date:** [September 4, 2023, 9:27am UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-create-knn-index-on-elasticsearch-version-8-7-1/342101/6 "2023-09-04T09:27:08Z")

</div>

hi there @Sharad_Nautiyal,

dense\_vector should be a supported data type ([see documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/dense-vector.html)) Could be that its not showing up on the autocomplete but is supported.

Joe

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 2, 2023, 9:27am UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-create-knn-index-on-elasticsearch-version-8-7-1/342101/7 "2023-10-02T09:27:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
