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 ...

Get Mastering Elasticsearch 5.x - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.