Hello,
i have some issues with query boosting, here is my search request in PHP:
$params = [
'index' => 'formations',
'type' => 'all',
"from" => 0, "size" => 40,
"body" => [
"query" => [
"bool" => [
"should" => [
"multi_match" => [
"fields" => ["name^150", "cities^110"],
"query" => $request->research
]
]
]
],
"highlight" =>[
"pre_tags" => ['<strong class="text-primary">'],
"post_tags" => ['</strong>'],
'fields' => [
'villes' => new \stdClass(),
],
]
]
];
When i apply a boost of 150 on the name field, its all working fine, guessing im typing 'bartender' in research bar. If i add a city to the research like 'bartender chicago' , all results containing the word bartender will come first ,I want that if the search contains the 2 keywords it will come first in the results.
But if i apply a boost > 150 on the city, if i type any name and Chicago, it will always show results with chicago first
Can someone explain me how i can do that ?
Here an example of the data i push :
$data = [
'body' => [
'id' => 1,
'intitule' => "bartender",
'cities' => ['chicago', 'new York'],
'index' => "formations",
'type' => 'all',
'id' => 1,
];
$data = [
'body' => [
'id' => 2,
'intitule' => "bartender",
'cities' => ['new York'],
'index' => "formations",
'type' => 'all',
'id' => 2,
];
Thanks a lot,
sorry for my english