liveBook · Manning

Reindexing

As explained in MongoDB 8.0 in Action, Third Edition

Reindexing is the process of rebuilding a search index from source data according to an updated index definition.

Reindexing rebuilds an Atlas Search index after its mapping changes. Atlas Search reads relevant source data, reorganizes it under the new mapping, and switches indexes after completion. section 11.3.3

Plan reindexing around these operational considerations:

  • Keep serving queries without downtime because the old index remains available while the replacement builds. section 11.3.3
  • Reserve free disk space equal to 125% of the current index size before updating it. section 11.3.3
  • Expect rebuilds when adding or scaling Search Nodes or when internal mongot changes require index resynchronization. section 11.3.3

Mapping update workflow

1. Change the Atlas Search mapping, analyzer, or indexed fields. 2. Confirm adequate disk capacity. 3. Let Atlas build the new index in the background while the old index serves queries. 4. Use the new index after Atlas completes the seamless transition and removes the old one. 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 Atlas Search index syntax to identify mapping and analyzer changes that can trigger reindexing. section 11.3.3

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Explains the rebuild lifecycle, resource requirement, availability behavior, and triggering infrastructure events without detailing commands.
Examples
Uses mapping changes, Search Node additions or scaling, and internal mongot changes as rebuild scenarios.
What it assumes
Assumes an existing Atlas Search index whose mapping or supporting configuration needs modification.
What you can do after
Operate Atlas Search updates while preserving queries and planning disk capacity for background index construction.
How it connects
Ties reindexing to Atlas Search indexes, mappings, analyzers, Search Nodes, and mongot resynchronization.

Also explained in

Compare how 2 books explain reindexing →

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.