I am pretty new to elasticsearch and just need some clarification: Can we define a analyzer while querying the search server. I tried it with the \"text\" and \"field\" query an
You can set a custom search-analyzer to be used for queries.
From the docs:
Usually, the same analyzer should be applied at index time and at search time, to ensure that the terms in the query are in the same format as the terms in the inverted index.
Sometimes, though, it can make sense to use a different analyzer at search time, such as when using the analysis-edgengram-tokenizer for autocomplete.
By default, queries will use the
analyzerdefined in the field mapping, but this can be overridden with thesearch_analyzersetting
The docs also list an example. https://www.elastic.co/guide/en/elasticsearch/reference/current/search-analyzer.html