On this page
You can use the Atlas Search
autocomplete type to index text values in
string fields for autocompletion. You can configure an
type to satisfy a variety of use cases. To learn more about the
configuration options available for the
autocomplete type, such as
tokenization strategy and diacritic folding, see
autocomplete Field Properties. You can query fields
autocomplete type only using the autocomplete
You can also use the
autocomplete type to index:
Fields whose value is an array of strings. To learn more, see How to Index the Elements of an Array.
String fields inside an array of documents indexed as the embeddedDocuments type.
If you have a large number of documents and a wide range of data
against which you want to run Atlas Search queries using the
autocomplete operator, building this index can take
some time. Alternatively, you can create a separate index with only
autocomplete type to reduce the impact on other indexes and
queries while the index builds.
To learn more, see Atlas Search Index Performance Considerations.
Atlas Search doesn't dynamically index
fields of type
autocomplete. You must use static mappings to index
autocomplete fields. You can
use the Visual Editor or the JSON Editor in the Atlas UI
to index fields of type
To define the index for the
autocomplete type, choose your preferred
configuration method in the Atlas UI and then select the
database and collection.
The Atlas Search
autocomplete type takes the following parameters:
Human-readable label that identifies this field type. Value must be string.
Name of the analyzer to use with this
autocomplete mapping. You can use any Atlas Search analyzer except the
This option isn't available in the Visual Editor.
Maximum number of characters per indexed sequence. The value limits the character length of indexed tokens. When you search for terms longer than the
Minimum number of characters per indexed sequence. We recommend
Tokenization strategy to use when indexing the field for autocompletion. Value can be one of the following:
When tokenized with a
Indexing a field for autocomplete with an
Flag that indicates whether to include or remove diacritics from the indexed text. Value can be one of the following: