Hi,
I am using the following query:
{
"_source": [
"title",
"bench",
"id_",
"court",
"date",
"content"
],
"size": 15,
"from": 0,
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "london",
"fields": [
"title",
"content"
]
}
}
],
"should": [
{
"multi_match": {
"query": "London is a beautiful city and has a lot of amazing landmarks. I love the Thames!",
"fields": [
"title",
"content^2"
],
"operator": "or"
}
}
]
}
},
"highlight": {
"pre_tags": [
"<tag1>"
],
"post_tags": [
"</tag1>"
],
"fields": {
"content": {}
},
"number_of_fragments": 5,
"fragment_size": 300
}
}
The rational of the query is that the word London
must be present while those in the should
query should just boost the score. What I would like to do is that within the should query, I would like to boost the phrase beautiful city
and the word Thames
. How do I do it?
PS: Content
and Title
are standard text fields with no analyzers applied on them.
Regards