liveBook · Manning

Stop-word removal

As explained in Elasticsearch in Action, Second Edition

A token filter that removes configured stop words from analyzed text.

Stop-word removal filters configured words from analyzed text. In Elasticsearch, the standard analyzer includes a stop token filter, but disables it by default; enabling it removes common words such as “of,” “a,” and “is.” section 7.3.1

Enable English stop words

Configure the analyzer during index creation with "stopwords": "_english_", then call the index’s _analyze endpoint to verify that configured words disappear from the token output. section 7.3.1

Listing 7.5 The standard analyzer with a stop words filter enabled
PUT my_index_with_stopwords
{
  "settings": {
    "analysis": {
      "analyzer": {                    #1
        "standard_with_stopwords":{    #2
          "type":"standard",           #3
          "stopwords":"_english_"      #4
        }
      }
    }
  }
}
#1 Sets the analyzer for the index
#2 Names the analyzer
#3 The standard analyzer type
#4 Enables the English stop words filter

Use the analyzer definition to see how stop-word removal is enabled alongside the standard tokenizer and other analysis settings. section 7.3.1

Choose the stop-word source to match the search domain:

  • Use language presets such as English or Hindi when the language’s standard stop words fit the application. section 7.3.1
  • Use stopwords_path to load a custom list, such as domain-specific or blacklisted terms, from a file. section 7.3.1
  • Test the resulting tokens with _analyze before relying on the analyzer for indexed text. section 7.3.1

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Explains default behavior, index configuration, language presets, custom files, and token verification, without descending into filter internals.
Examples
Demonstrates English and Hindi stop words, a custom swear-word file, and analyzed text whose configured words are removed.
What it assumes
Assumes basic Elasticsearch index and analyzer configuration while teaching stop filters and token inspection directly.
What you can do after
Operate/configure Elasticsearch analyzers and verify stop-word removal through the _analyze endpoint.
How it connects
Connects stop-word removal to the standard analyzer, token filters, tokenizers, index settings, and the _analyze endpoint.

Also explained in

Compare how 4 books explain stop-word removal →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elasticsearch in Action, Second Edition. The section links point to the parts of the book it draws on.