Every time the search_value is encountered, it gets boosted. I would like to to be boosted only once if encountered, or twice as per requirements. How can I avoid multiple boost given to matches?
The documentation says that if you change index_option to docs, it will disable term frequencies. However, i cannot use match_phrase option then.
Thanks a lot for your opinion and ideas!
The boost is applied to the score of the match query so it's only applied once per matching document.
Though the score of the match query takes the frequency of the "search_value" into account so the score for a document with multiple occurrences of this term will be different than a document with a single occurrence.
If you want to ignore the frequencies of the terms you can use the boolean similarity: https://www.elastic.co/guide/en/elasticsearch/reference/master/similarity.html
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Unknown Similarity type [boolean] for field [skills]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [candidate]: Unknown Similarity type [boolean] for field [skills]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Unknown Similarity type [boolean] for field [skills]"
}
},
"status": 400
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.