I am just in the process of attempting to upgrade ElasticSearch and Nest to versions 2.3 from 1.7 and I am having some issues with the changes to the API. Most of it is fine and just a case of renaming things or removing some filter clauses but what is causing me serious problems is the fact that the similarities method when creating an index, no longer has an option for specifying a custom similarity.
We need to be able to set the QueryNorm to a fixed value as we do cross index searching as a part of the general search on the app and then those results need to be ranked against each other. We do this by giving up on TF/IDF and just assigning constant scores based on which fields the text matches in (so matching in a title gives you a higher rank than the description). E.g. when doing a global search, a contact that matches perfectly in the title should have the same score as a meeting that matches perfectly in the title.
To achieve that, we wrote our own custom similarity and hooked it up like this:
client.CreateIndex(x => x.Index(newIndexName).AddAlias(GetWriteAlias()) .Similarity(s => s.CustomSimilarities(cs => cs.Add("default", new CustomSimilarity())))
Now, however, I cannot see how to do that.
Is it still possible to do this is the latest version of ElasticSearch and Nest or have custom similarities been quietly deprecated?
Even better, would it be possible to do what I am trying to do without needing a custom similarity?