O'Reilly logo

Mastering Elasticsearch 5.x - Third Edition by Bharvi Dixit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Choosing the default similarity model

In order to change the similarity model used by default, we need to provide a configuration of a similarity model that will be called by default. For example, if we would like to use our mastering_similarity name as the default one, we would have to change the preceding configuration to the following one (the whole example is stored in the posts_default_similarity.json file):

{ 
  "settings" : { 
  "index" : { 
    "similarity" : { 
      "default" : { 
        "type" : "classic", 
        "discount_overlaps" : false 
      } 
    } 
  } 
  }, 
  ... 
}

Because of the fact that the query norm and coordination factors (which were explained in The changed default text scoring in Lucene section, in Chapter 2, The Improved Query DSL) are used by all similarity models globally ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required