Elasticsreach boosting query by field value


Elasticsreach boosting query by field value



I want to search in documents which some words in one filed are more important than others,



For example:



US intelligence believes North Korea is making more nuclear bomb fuel despite talks



Is there a way to Elasticsearch understand it?
Some thing like this:


US^5 intelligence believes (North Korea)^10 is making more (nuclear bomb)^8 fuel despite talks




1 Answer
1



There is a Dynamic boosting method suggested here



What they do is two have 2 (or more) queries, and boost them differently, e.g.


{
"query": {
"bool": {
"should": [
{
"match": {
"MyFieldName": {
"query": "nuclear bomb",
"boost": 8
}
}
},
{
"match": {
"content": "other query terms there"
}
}
]
}
}
}






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Extract Id from Twitch Clip URL

Why are these constructs (using ++) undefined behavior in C?

I'm Still Waiting (Diana Ross song)