I need to remove the stop words from query in elasticsearch. I am able to apply analyzer at index level but let me know how to apply analyzer at query or search level in elasticsearch.
1 Answer
you have to configure your elasticsearch mappings to add search_analyzers to fields you want to analyze query time.
like
{
"service" :{
"_source" : {"enabled" : true },
"properties":{
"name" : {"type" : "string", "index" : "not_analyzed"},
"name_snow": { "type": "string", "search_analyzer": "simple_analyzer", "index_analyzer": "snowball_analyzer" }
}
}
}
when you will query on this field, the terms entered will be analyzed first than queries in the shard.