0

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.

user310079
  • 11
  • 3

1 Answers1

0

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.

user3775217
  • 4,675
  • 1
  • 22
  • 33