Is there a way in elasticsearch to boost the importance of the exact phrase appearing in the the document?
For example if I was searching for the phrase \"web develo
As an alternative to javanna's answer, you could do something similar with must
and should
clauses within a bool
query:
{
"query": {
"bool": {
"must": {
"match": {
"field": "web developer",
"operator": "and"
}
},
"should": {
"match_phrase": {
"field": "web developer"
}
}
}
}
}
Untested, but I believe the must
clause here will match results containing both 'web' and 'developer' and the should
clause will score phrases matching 'web developer' higher.