From b53e8e12746f2740b00f5521c8abd0d58c4ec624 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh Date: Mon, 4 Mar 2024 09:18:36 -0500 Subject: [PATCH 1/5] add note about search index --- source/fundamentals/atlas-search.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/fundamentals/atlas-search.txt b/source/fundamentals/atlas-search.txt index 53a95e6d..1f5ef2b0 100644 --- a/source/fundamentals/atlas-search.txt +++ b/source/fundamentals/atlas-search.txt @@ -106,6 +106,10 @@ collection using the string "Gib" in the ``make`` field. :language: csharp :dedent: +.. note:: + If the field you are searching has a search index, it must be included in your ``Autocomplete`` call: + ``Search.Autocomplete(g => g.Make, "Gib"), indexName: )`` + The search returns the following document: .. code-block:: json From dc7af2b67421f971188c08499b3a5628ee83cf52 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh Date: Mon, 4 Mar 2024 14:48:00 -0500 Subject: [PATCH 2/5] RR review P1 --- source/fundamentals/atlas-search.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/fundamentals/atlas-search.txt b/source/fundamentals/atlas-search.txt index 1f5ef2b0..b40f3252 100644 --- a/source/fundamentals/atlas-search.txt +++ b/source/fundamentals/atlas-search.txt @@ -107,6 +107,7 @@ collection using the string "Gib" in the ``make`` field. :dedent: .. note:: + If the field you are searching has a search index, it must be included in your ``Autocomplete`` call: ``Search.Autocomplete(g => g.Make, "Gib"), indexName: )`` From 98dabc1bb1358b4932fe7ef867c574ad54fca222 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh Date: Fri, 15 Mar 2024 14:01:07 -0400 Subject: [PATCH 3/5] update eg --- source/fundamentals/atlas-search.txt | 3 +-- .../code-examples/atlas-search/AtlasSearchExamples.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/fundamentals/atlas-search.txt b/source/fundamentals/atlas-search.txt index b40f3252..ea21df38 100644 --- a/source/fundamentals/atlas-search.txt +++ b/source/fundamentals/atlas-search.txt @@ -108,8 +108,7 @@ collection using the string "Gib" in the ``make`` field. .. note:: - If the field you are searching has a search index, it must be included in your ``Autocomplete`` call: - ``Search.Autocomplete(g => g.Make, "Gib"), indexName: )`` + If the field you are searching has a search index, it must be included in your ``Autocomplete`` call. If a search index does not exist, the default index is used. The search returns the following document: diff --git a/source/includes/fundamentals/code-examples/atlas-search/AtlasSearchExamples.cs b/source/includes/fundamentals/code-examples/atlas-search/AtlasSearchExamples.cs index 77bd9d55..2a21ba0c 100644 --- a/source/includes/fundamentals/code-examples/atlas-search/AtlasSearchExamples.cs +++ b/source/includes/fundamentals/code-examples/atlas-search/AtlasSearchExamples.cs @@ -29,7 +29,7 @@ public static List AutocompleteSearch() // Finds documents with a "make" value that contains the string fragment "Gib" // start-autocomplete-search var result = guitarsCollection.Aggregate() - .Search(Builders.Search.Autocomplete(g => g.Make, "Gib")) + .Search(Builders.Search.Autocomplete(g => g.Make, "Gib"), indexName: "guitarmakes") .ToList(); // end-autocomplete-search From 38fc2e350b0d42911208eb80f4c6942bff4e715a Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh Date: Fri, 15 Mar 2024 14:22:03 -0400 Subject: [PATCH 4/5] RR review --- source/fundamentals/atlas-search.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/fundamentals/atlas-search.txt b/source/fundamentals/atlas-search.txt index ea21df38..c1dafff2 100644 --- a/source/fundamentals/atlas-search.txt +++ b/source/fundamentals/atlas-search.txt @@ -108,7 +108,7 @@ collection using the string "Gib" in the ``make`` field. .. note:: - If the field you are searching has a search index, it must be included in your ``Autocomplete`` call. If a search index does not exist, the default index is used. + 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. The search returns the following document: From 6b8c9bc00699b510830392d1b456f93b38e0f971 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh Date: Fri, 15 Mar 2024 14:31:09 -0400 Subject: [PATCH 5/5] removed extra comma --- source/fundamentals/atlas-search.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/fundamentals/atlas-search.txt b/source/fundamentals/atlas-search.txt index c1dafff2..07127f35 100644 --- a/source/fundamentals/atlas-search.txt +++ b/source/fundamentals/atlas-search.txt @@ -108,7 +108,7 @@ collection using the string "Gib" in the ``make`` field. .. note:: - 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. + 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. The search returns the following document: