I have a problem understanding the operation of the boost parameter in Elasticsearch 6.
I have an index with four fields: id, title, content, client. All fields are of type "text".
With the following query I try to give the title field a higher weight:
{
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "europe",
"analyzer": "standard",
"default_operator": "AND",
"fields": [
"id", "title^2", "content"
]
}
},
{
"term": {
"client": {
"value": "test",
"boost": 1
}
}
}
]
}
},
"size": 10,
"from": 0,
"sort": [
{
"_score": {
"order": "desc"
}
}
]
}
What I would expect now would be that I get search results where the first hits are only records that contain the search term in the title, but not necessarily in the content. However, I only get hits that contain the search term in both the title and the content, ie a multi-field matching.
Can I somehow influence this, perhaps by increasing the boost value or reformulating the request? I also read something about a dismax query, but I do not know if that is useful for my purposes?
ANDOperator, thus it expects all the fields to have the value you are looking for. did you try changing the boolean operator toOR?