How can I specify query rules for each index when searching through multiple indices?
Because indexed the same table twice with different mappings. But I need different query rules for each index when i'm searching.
$params = [
'index' => 'serviceme,serviceme_ngram',
'type' => 'products,products',
'size' => $size,
'body' => [
'query' => [
"bool" => [
'should' => [
[
'match' => [
'product_number' => [
'query' => $query,
]
]
],
[
'match' => [
'producer_name' => [
'query' => $query,
]
]
],
[
'match' => [
'product_name' => [
'query' => $query,
]
]
],
[
'match' => [
'producer_name' => [
'query' => $query,
'fuzziness' => 'AUTO'
]
]
],
[
'match' => [
'product_name' => [
'query' => $query,
'fuzziness' => 'AUTO'
]
]
]
/* [
'multi_match' => [
'query' => $query,
'fuzziness' => 'AUTO',
"prefix_length" => 0,
"max_expansions" => 100,
'fields' => ['product_number', 'product_name', 'producer_name'],
]
] */
]
]
]
]
];