Stopwords in analyzer doesn't seem to work

I am creating an index using the following code :

     es.indices.create(index= "newtest",
      body= {
         "settings": {
            "analysis": {
               "analyzer": {

                  "std_english": {
                      "type":      "standard",
                      "stopwords": "_english_",
                      "filter" : ["lowercase"]
                  }
             }
           }
        },
        "mappings": {
            "properties": {
              "content": {
                "type":     "text",
                "analyzer": "std_english" 
              }
           }
        }
    })

When I index documents and verify what has been indexed, I still see stop words in the content.

Note that if by "content", you are meaning the _source which contains the JSon document you sent, this is expected as elasticsearch does not modify the json you sent.

Use the _analyze API to see how the content is actually indexed and if the stop words are eventually removed. If not, please share your full reproduction script.

Thanks for the insight, David. Yes, I meant ['_source']['content'].
I confirmed by using _analyze API that the stop words are getting filtered out for a sample text.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.