liveBook · Manning

Text analyzer

As explained in MongoDB 8.0 in Action, Third Edition

A text analyzer is a search component that processes text into terms for indexing and querying.

A text analyzer processes text into searchable terms for indexing and querying. It tokenizes text into words, phrases, or symbols, then applies parsing and language rules so Atlas Search can find matching content. section 11.3.3

Choose an analyzer when defining an Atlas Search index, and optionally choose a separate search analyzer for query text. This controls how indexed fields and searches are converted into terms. section 11.3.3

Atlas Search provides built-in analyzer choices:

  • Standard uses the default analyzer for Atlas Search indexes and queries. section 11.3.3
  • Simple divides text wherever it finds a nonletter character. section 11.3.3
  • Whitespace divides text wherever it finds whitespace. section 11.3.3
  • Language provides language-specific text analyzers. section 11.3.3
  • Keyword indexes a text field as one term. section 11.3.3
Listing 11.1 Atlas Search index syntax
{
  "analyzer": "<analyzer-for-index>",
  "searchAnalyzer": "<analyzer-for-query>",
  "mappings": {
    "dynamic": <boolean>,
    "fields": { <field-definition> }
  },
  "analyzers": [ <custom-analyzer> ],
  "storedSource": <boolean> | {
    <stored-source-definition>
  },
  "synonyms": [
    {
      "name": "<synonym-mapping-name>",
      "source": {
        "collection": "<source-collection-name>"
      },
      "analyzer": "<synonym-mapping-analyzer>"
    }
  ]
}

Use the index-definition template to connect an analyzer and searchAnalyzer with field mappings, dynamic mapping, custom analyzers, stored source, and synonyms. section 11.3.3

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Explains tokenization, parsing, language rules, analyzer selection, and built-in choices without detailing analyzer internals.
Examples
Uses Standard, Simple, Whitespace, Language, and Keyword analyzers as configuration examples.
What you can do after
Configure Atlas Search index and query processing by selecting built-in or custom analyzers.
How it connects
Connects text analyzers with tokenization, Atlas Search indexes, query text, field mappings, and full-text search.

Also explained in

Compare how 2 books explain text analyzer →

Related concepts

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