Docs Menu
Docs Home
/
MongoDB Atlas
/ /

Troubleshoot Atlas Search Errors

On this page

  • Initial Sync in Progress
  • mongot Process Not Installed or Running
  • Empty Result Set
  • PlanExecutor Error
  • Failed to Execute search Command Error

Atlas Search starts the initial sync process in the following scenarios:

  • When you create a new cluster or perform certain upgrades on a cluster, an initial sync process occurs.

  • If you add shards to a collection with an existing Atlas Search index, an initial sync occurs on the added shards for that index.

  • If you shard a collection that already has an Atlas Search index, an initial sync occurs on shards where the collection begins to exist.

The initial sync process includes the following steps:

  1. The mongod performs an initial sync.

  2. The mongot performs an initial sync, which rebuilds the search indexes.

While a search index rebuilds, you can still perform $search queries on the existing indexed fields. However, Atlas Search might return an error if you run a $search query against a new field or a node that you've recently created. Try your query again after the initial syncs complete and mongot rebuilds the indexes. You can check the status of the mongot initial sync using the following steps:

1
  1. If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

  3. If it's not already displayed, click Clusters in the sidebar.

    The Clusters page displays.

2

You can go the Atlas Search page from the sidebar, the Data Explorer, or your cluster details page.

  1. In the sidebar, click Atlas Search under the Services heading.

  2. From the Select data source dropdown, select your cluster and click Go to Atlas Search.

    The Atlas Search page displays.

  1. Click the Browse Collections button for your cluster.

  2. Expand the database and select the collection.

  3. Click the Search Indexes tab for the collection.

    The Atlas Search page displays.

  1. Click the cluster's name.

  2. Click the Atlas Search tab.

    The Atlas Search page displays.

3
  1. In the index's Status column, click View Status Details.

  2. Check the state of the index for the node. During mongot initial sync, the status is INITIAL SYNC. When mongot finishes rebuilding the index, the status is ACTIVE.

The following error is returned if you run $search queries when the Atlas Search mongot process isn't installed or running:

MongoError: Remote error from mongot :: caused by :: Error connecting to localhost:28000.

The mongot process is installed only when the first Atlas Search index is defined. If you don't have any Atlas Search index in your Atlas cluster, create at least one Atlas Search index to resolve this error.

Tip

See also:

  • Review Atlas Search Index Syntax

  • Create an Atlas Search Index

mongot doesn't return any errors, but returns an empty result set if your $search query:

  • References an index that doesn't exist. If you don't specify an index by name in the query, Atlas Search defaults to an index named default. If you don't have an index named default or if the index that you specified doesn't exist, Atlas Search doesn't return an error and returns an empty result set. You can specify a valid index by its name using the index option. To learn more, see Atlas Search aggregation pipeline stage options.

  • Specifies a non-indexed field. If you run a query against a field that isn't indexed, Atlas Search doesn't return an error and returns an empty result set. You must specify only indexed fields as values for the path parameter. You can enable dynamic mapping in your index definition for the collection to ensure that all the dynamically indexable fields in the collection are automatically indexed. To learn more, see dynamic mapping.

  • Uses the text operator on a field path which is not indexed as a string type. If a field is indexed as an Atlas Search field type other than string, such as stringFacet or autocomplete, Atlas Search doesn't return an error and returns an empty result set. You must index the fields with string BSON data type values as string type to query the fields using the text operator.

mongot returns a PlanExecutor error if your $search query:

  • Specifies a field that is indexed as an incorrect data type. In this case, if you run a query, Atlas Search returns an error message identifying the field that was indexed incorrectly and its correct data type. For example:

    PlanExecutor error during aggregation :: caused by :: Cannot facet on field "genres" because
    it was not indexed as a "stringFacet" field.

    For example, to run facet queries against string, number, or date fields, create an index for the fields using the corresponding Atlas Search field type such as stringFacet, numberFacet, and dateFacet respectively. To learn more, see Supported and Unsupported Data Types.

If you deployed mongot to run alongside mongod (i.e. didn't configure Search Nodes for Workload Isolation), mongot might return this error if the mongot process terminates, such as during any of the following events:

  • Cluster upscale

  • Node failover

  • mongot upgrade

If you deployed mongot on a dedicated search node, mongod uses a proxy that is aware of each search node and therefore, mongod routes search queries to only healthy nodes where the mongot is active.

Back

Explain Timing