From ede1e252e4b219f2be579a34c5416e2fae885a70 Mon Sep 17 00:00:00 2001 From: rustagir Date: Thu, 10 Apr 2025 12:05:20 -0400 Subject: [PATCH 1/2] DOCSP-48252: autocomplete index link/note --- source/fundamentals/atlas-search.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/fundamentals/atlas-search.txt b/source/fundamentals/atlas-search.txt index 54c2df3c..da437fc1 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:: Search 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 Search index, you must pass the index name to + the ``Autocomplete()`` method, as shown in the preceding code. The search returns the following document: From ed0c07f450e8cb2b085318af3c26b4c69f4a0d01 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 11 Apr 2025 09:20:17 -0400 Subject: [PATCH 2/2] SA small fix --- source/fundamentals/atlas-search.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/fundamentals/atlas-search.txt b/source/fundamentals/atlas-search.txt index da437fc1..df02b38c 100644 --- a/source/fundamentals/atlas-search.txt +++ b/source/fundamentals/atlas-search.txt @@ -97,14 +97,14 @@ field for text that starts with the string ``"Gib"``. :language: csharp :dedent: -.. note:: Search Index for Autocomplete Queries +.. note:: Index for Autocomplete Queries 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 Search index, you must pass the index name to + 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: