My console query looks like this:
{
"query": {
"dis_max": {
"tie_breaker": 0.7,
"boost": 1.2,
"queries": [
{
"multi_match": {
"query": "this exact phrase",
"type": "phrase",
"boost": 3,
"fields": [
"title^8",
"metadesc^7", "kws^7",
"content^6", "com^6", "prom^6"
]
}
},
{
"multi_match": {
"query": "this exact phrase",
"operator": "and",
"boost": 2,
"fields": [
"title^8",
"metadesc^7", "kws^7",
"content^6", "com^6", "prom^6"
]
}
},
{
"multi_match": {
"query": "this exact phrase",
"fields": [
"title^8",
"metadesc^7", "kws^7",
"content^6", "com^6", "prom^6"
]
}
}
]
}
}
}
I can't get dis_max
with multi_match query to work in PHP.
stdClass Object
(
[query] => stdClass Object
(
[dis_max] => stdClass Object
(
[boost] => 1.2
[tie_breaker] => 0.7
[queries] => Array
(
[0] => stdClass Object
(
[multi_match] => stdClass Object
(
[fields] => Array
(
[0] => title
)
[query] => this exact phrase
[analyzer] => asciifolding_text
)
)
[1] => stdClass Object
(
[multi_match] => stdClass Object
(
[fields] => Array
(
[0] => metadesc
[1] => kws
)
[query] => this exact phrase
[analyzer] => asciifolding_text
)
)
[2] => stdClass Object
(
[multi_match] => stdClass Object
(
[query] => this exact phrase
[analyzer] => asciifolding_text
[fields] => Array
(
[0] => content
[1] => com
[2] => prom
)
)
)
)
)
)
)
This is as close as I got, but still no luck. Anybody who knows where is the problem? Thanks.
Note: It is just first part of the query -- first multi_match