NEST API Setting default similarity to "classic" not BM25 programatically . how?

Hello,

I was able to do this using query dsl.

post my_index/_close

put my_index/_settings
{
  "settings": {
    "index": {
      "similarity": {
        "default": {
          "type": "classic"
        }
      }
    }
  }
}

post my_index/_open

But i'm having problem converting this to Nest. If you could give me a link related to this/or if you did the same, your inputs will be greatly appreciated.

Thank you!

Our goal is to use the classic similarity for all the indices. I solved my problem using template.

PUT /_template/template_1?pretty
{

  "template": "*",

  "settings": {
    "index": {
      "similarity": {
        "default": {
          "type": "classic"
        }
      }
    }
  },

  "mappings": {

  }

}

https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html

Setting Classic similarity in NEST is missing; I've opened an issue to addess.

cool, thanks!

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