Reputation: 139
I have a field say "testField", where in there can be numerous string values like. I need to boost the score whenever the value in the field is a particular string,say for example "testValue". How can I do this in elasticsearch?
Upvotes: 1
Views: 61
Reputation: 52368
You can try using function_score
:
{
"query": {
"function_score": {
"query": {
"match_all": {}
},
"functions": [
{
"filter": {
"term": {
"testField": "testValue"
}
},
"boost_factor": 15
}
]
}
}
}
Upvotes: 2