diff --git a/source/fundamentals/atlas-search.txt b/source/fundamentals/atlas-search.txt index 54c2df3c..df02b38c 100644 --- a/source/fundamentals/atlas-search.txt +++ b/source/fundamentals/atlas-search.txt @@ -88,8 +88,8 @@ Autocomplete Use the ``Autocomplete()`` method to search for a word or phrase that contains a sequence of characters from an incomplete input string. -The following example performs an autocomplete search on the ``guitars`` -collection using the string "Gib" in the ``make`` field. +The following example performs an autocomplete query on the ``make`` +field for text that starts with the string ``"Gib"``. .. literalinclude:: /includes/fundamentals/code-examples/atlas-search/AtlasSearchExamples.cs :start-after: // start-autocomplete-search @@ -97,9 +97,15 @@ collection using the string "Gib" in the ``make`` field. :language: csharp :dedent: -.. note:: +.. note:: Index for Autocomplete Queries - If the field you are searching on is indexed by a search index, you must pass the index name to the ``Autocomplete`` call. If a search index does not exist, the default index is used. + You must create an Atlas Search index that supports autocompletion + to successfully perform autocomplete queries. To learn more, see + :atlas:`How to Index Fields for Autocompletion ` + in the Atlas documentation. + + After you create the Atlas Search index, you must pass the index name to + the ``Autocomplete()`` method, as shown in the preceding code. The search returns the following document: