I would like to use a different analyzer at query time to compose my query.
I read that is possible from the documentation "Controlling Analysis" :
[...] the full sequence at search time:
- The analyzer defined in the query itself, else
- The search_analyzer defined in the field mapping, else
- The analyzer defined in the field mapping, else
- The analyzer named default_search in the index settings, which defaults to
- The analyzer named default in the index settings, which defaults to
- The standard analyzer
But i don't know how to compose the query in order to specify different analyzers for different clauses:
"query" => [
"bool" => [
"must" => [
{
"match": ["my_field": "My query"]
"<ANALYZER>": <ANALYZER_1>
}
],
"should" => [
{
"match": ["my_field": "My query"]
"<ANALYZER>": <ANALYZER_2>
}
]
]
]
I know that i can index two or more different fields, but I have strong secondary memory constraints and I can't index the same information N times.
Thank you