Complete the code to create a dis_max query with two match queries.
{
"query": {
"dis_max": {
"queries": [
{ "match": { "title": "[1]" } },
{ "match": { "description": "search text" } }
]
}
}
}The dis_max query combines multiple queries and uses the highest score. Here, the first match query should search for "search text" in the title field.
Complete the code to set the tie_breaker parameter to 0.7 in the dis_max query.
{
"query": {
"dis_max": {
"tie_breaker": [1],
"queries": [
{ "match": { "title": "search text" } },
{ "match": { "description": "search text" } }
]
}
}
}The tie_breaker parameter controls how much the scores of non-best matching queries contribute. Setting it to 0.7 means 70% of the other scores add to the max score.
Fix the error in the dis_max query by completing the missing field name.
{
"query": {
"dis_max": {
"queries": [
{ "match": { "[1]": "search text" } },
{ "match": { "description": "search text" } }
]
}
}
}The first match query must specify the field name to search. "title" is the correct field name here.
Fill both blanks to create a dis_max query with a tie_breaker and two match queries on 'title' and 'content'.
{
"query": {
"dis_max": {
"tie_breaker": [1],
"queries": [
{ "match": { "title": "search text" } },
{ "match": { "[2]": "search text" } }
]
}
}
}The tie_breaker is set to 0.5 to balance scores. The second match query searches the 'content' field.
Fill all three blanks to build a dis_max query with tie_breaker, boost, and two match queries on 'title' and 'summary'.
{
"query": {
"dis_max": {
"tie_breaker": [1],
"boost": [2],
"queries": [
{ "match": { "title": "search text" } },
{ "match": { "[3]": "search text" } }
]
}
}
}The tie_breaker is 0.3 to allow some contribution from other queries. The boost is 1.5 to increase overall score weight. The second match query searches the 'summary' field.