On this page
Atlas Search can't perform
$search queries against an Atlas cluster
during an initial sync process. Atlas Search starts the initial sync process in the
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:
mongodperforms an initial sync.
mongotperforms an initial sync, which rebuilds the search indexes.
As a result, you may receive an error when running a
$search query against a
node that you recently created or upgraded. 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:
Click the Search tab for your database deployment.
In the index's
Statuscolumn, click View Status Details.
Check the state of the index for the node. During
mongotinitial sync, the status is
INITIAL SYNC. When
mongotfinishes rebuilding the index, the status is
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.
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.
mongot doesn't return any errors, but returns an empty result set if
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
defaultor 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
indexoption. 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
pathparameter. 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.
textoperator on a field path which is not indexed as a
stringtype. If a field is indexed as an Atlas Search field type other than
string, such as
autocomplete, Atlas Search doesn't return an error and returns an empty result set. You must index the fields with
stringBSON data type values as string type to query the fields using the text operator.
mongot returns a
PlanExecutor error if your
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
datefields, create an index for the fields using the corresponding Atlas Search field type such as
dateFacetrespectively. To learn more, see Supported and Unsupported Data Types.