You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/index-add-suggesters.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,13 @@ author: HeidiSteen
8
8
ms.author: heidist
9
9
ms.service: cognitive-search
10
10
ms.topic: conceptual
11
-
ms.date: 03/26/2021
11
+
ms.date: 09/12/2022
12
12
ms.custom: devx-track-csharp
13
13
---
14
14
15
15
# Create a suggester to enable autocomplete and suggested results in a query
16
16
17
-
In Azure Cognitive Search, typeahead or "search-as-you-type" is enabled through a *suggester*. A suggester provides a list of fields that undergo additional tokenization, generating prefix sequences to support matches on partial terms. For example, a suggester that includes a City field with a value for "Seattle" will have prefix combinations of "sea", "seat", "seatt", and "seattl" to support typeahead.
17
+
In Azure Cognitive Search, typeahead or "search-as-you-type" is enabled through a *suggester*. A suggester provides a list of fields that undergo extra tokenization, generating prefix sequences to support matches on partial terms. For example, a suggester that includes a City field with a value for "Seattle" will have prefix combinations of "sea", "seat", "seatt", and "seattl" to support typeahead.
18
18
19
19
Matches on partial terms can be either an autocompleted query or a suggested match. The same suggester supports both experiences.
20
20
@@ -26,7 +26,7 @@ The following screenshot from [Create your first app in C#](tutorial-csharp-type
26
26
27
27

28
28
29
-
You can use these features separately or together. To implement these behaviors in Azure Cognitive Search, there is an index and query component.
29
+
You can use these features separately or together. To implement these behaviors in Azure Cognitive Search, there's an index and query component.
30
30
31
31
+ Add a suggester to a search index definition. The remainder of this article is focused on creating a suggester.
32
32
@@ -36,29 +36,29 @@ Search-as-you-type support is enabled on a per-field basis for string fields. Yo
36
36
37
37
## How to create a suggester
38
38
39
-
To create a suggester, add one to an [index definition](/rest/api/searchservice/create-index). A suggester takes a name and a collection of fields over which the typeahead experience is enabled. The best time to create a suggester is when you are also defining the field that will use it.
39
+
To create a suggester, add one to an [index definition](/rest/api/searchservice/create-index). A suggester takes a name and a collection of fields over which the typeahead experience is enabled. The best time to create a suggester is when you're also defining the field that will use it.
40
40
41
41
+ Use string fields only.
42
42
43
43
+ If the string field is part of a complex type (for example, a City field within Address), include the parent in the field path: `"Address/City"` (REST and C# and Python), or `["Address"]["City"]` (JavaScript).
44
44
45
45
+ Use the default standard Lucene analyzer (`"analyzer": null`) or a [language analyzer](index-add-language-analyzers.md) (for example, `"analyzer": "en.Microsoft"`) on the field.
46
46
47
-
If you try to create a suggester using pre-existing fields, the API will disallow it. Prefixes are generated during indexing, when partial terms in two or more character combinations are tokenized alongside whole terms. Given that existing fields are already tokenized, you will have to rebuild the index if you want to add them to a suggester. For more information, see [How to rebuild an Azure Cognitive Search index](search-howto-reindex.md).
47
+
If you try to create a suggester using pre-existing fields, the API will disallow it. Prefixes are generated during indexing, when partial terms in two or more character combinations are tokenized alongside whole terms. Given that existing fields are already tokenized, you'll have to rebuild the index if you want to add them to a suggester. For more information, see [How to rebuild an Azure Cognitive Search index](search-howto-reindex.md).
48
48
49
49
### Choose fields
50
50
51
-
Although a suggester has several properties, it is primarily a collection of string fields for which you are enabling a search-as-you-type experience. There is one suggester for each index, so the suggester list must include all fields that contribute content for both suggestions and autocomplete.
51
+
Although a suggester has several properties, it's primarily a collection of string fields for which you're enabling a search-as-you-type experience. There's one suggester for each index, so the suggester list must include all fields that contribute content for both suggestions and autocomplete.
52
52
53
53
Autocomplete benefits from a larger pool of fields to draw from because the additional content has more term completion potential.
54
54
55
-
Suggestions, on the other hand, produce better results when your field choice is selective. Remember that the suggestion is a proxy for a search document so you will want fields that best represent a single result. Names, titles, or other unique fields that distinguish among multiple matches work best. If fields consist of repetitive values, the suggestions consist of identical results and a user won't know which one to click.
55
+
Suggestions, on the other hand, produce better results when your field choice is selective. Remember that the suggestion is a proxy for a search document so you'll want fields that best represent a single result. Names, titles, or other unique fields that distinguish among multiple matches work best. If fields consist of repetitive values, the suggestions consist of identical results and a user won't know which one to click.
56
56
57
57
To satisfy both search-as-you-type experiences, add all of the fields that you need for autocomplete, but then use "$select", "$top", "$filter", and "searchFields" to control results for suggestions.
58
58
59
59
### Choose analyzers
60
60
61
-
Your choice of an analyzer determines how fields are tokenized and subsequently prefixed. For example, for a hyphenated string like "context-sensitive", using a language analyzer will result in these token combinations: "context", "sensitive", "context-sensitive". Had you used the standard Lucene analyzer, the hyphenated string would not exist.
61
+
Your choice of an analyzer determines how fields are tokenized and subsequently prefixed. For example, for a hyphenated string like "context-sensitive", using a language analyzer will result in these token combinations: "context", "sensitive", "context-sensitive". Had you used the standard Lucene analyzer, the hyphenated string wouldn't exist.
62
62
63
63
When evaluating analyzers, consider using the [Analyze Text API](/rest/api/searchservice/test-analyzer) for insight into how terms are processed. Once you build an index, you can try various analyzers on a string to view token output.
| name | Specified in the suggester definition, but also called on an Autocomplete or Suggestions request. |
142
142
| sourceFields | Specified in the suggester definition. It's a list of one or more fields in the index that are the source of the content for suggestions. Fields must be of type `Edm.String` and `Collection(Edm.String)`. If an analyzer is specified on the field, it must be a named lexical analyzer from [this list](/dotnet/api/azure.search.documents.indexes.models.lexicalanalyzername) (not a custom analyzer). </br></br>As a best practice, specify only those fields that lend themselves to an expected and appropriate response, whether it's a completed string in a search bar or a dropdown list. </br></br>A hotel name is a good candidate because it has precision. Verbose fields like descriptions and comments are too dense. Similarly, repetitive fields, such as categories and tags, are less effective. In the examples, we include "category" anyway to demonstrate that you can include multiple fields. |
143
-
| searchMode | REST-only parameter, but also visible in the portal. This parameter is not available in the .NET SDK. It indicates the strategy used to search for candidate phrases. The only mode currently supported is `analyzingInfixMatching`, which currently matches on the beginning of a term.|
143
+
| searchMode | REST-only parameter, but also visible in the portal. This parameter isn't available in the .NET SDK. It indicates the strategy used to search for candidate phrases. The only mode currently supported is `analyzingInfixMatching`, which currently matches on the beginning of a term.|
144
144
145
145
<aname="how-to-use-a-suggester"></a>
146
146
@@ -153,9 +153,9 @@ A suggester is used in a query. After a suggester is created, call one of the fo
In a search application, client code should leverage a library like [jQuery UI Autocomplete](https://jqueryui.com/autocomplete/) to collect the partial query and provide the match. For more information about this task, see [Add autocomplete or suggested results to client code](search-add-autocomplete-suggestions.md).
156
+
In a search application, client code should use a library like [jQuery UI Autocomplete](https://jqueryui.com/autocomplete/) to collect the partial query and provide the match. For more information about this task, see [Add autocomplete or suggested results to client code](search-add-autocomplete-suggestions.md).
157
157
158
-
API usage is illustrated in the following call to the Autocomplete REST API. There are two takeaways from this example. First, as with all queries, the operation is against the documents collection of an index and the query includes a "search" parameter, which in this case provides the partial query. Second, you must add "suggesterName" to the request. If a suggester is not defined in the index, a call to autocomplete or suggestions will fail.
158
+
API usage is illustrated in the following call to the Autocomplete REST API. There are two takeaways from this example. First, as with all queries, the operation is against the documents collection of an index and the query includes a "search" parameter, which in this case provides the partial query. Second, you must add "suggesterName" to the request. If a suggester isn't defined in the index, a call to autocomplete or suggestions will fail.
159
159
160
160
```http
161
161
POST /indexes/myxboxgames/docs/autocomplete?search&api-version=2020-06-30
Copy file name to clipboardExpand all lines: articles/search/search-synonyms.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ author: HeidiSteen
8
8
ms.author: heidist
9
9
ms.service: cognitive-search
10
10
ms.topic: conceptual
11
-
ms.date: 06/11/2021
11
+
ms.date: 09/12/2022
12
12
---
13
13
# Synonyms in Azure Cognitive Search
14
14
@@ -18,7 +18,7 @@ Within a search service, synonym maps are a global resource that associate equiv
18
18
19
19
A synonym map is an asset that can be created once and used by many indexes. The [service tier](search-limits-quotas-capacity.md#synonym-limits) determines how many synonym maps you can create, ranging from three synonym maps for Free and Basic tiers, up to 20 for the Standard tiers.
20
20
21
-
You might create multiple synonym maps for different languages, such as English and French versions, or lexicons if your content includes technical or obscure terminology. Although you can create multiple synonym maps in your search service, a field can only use one of them.
21
+
You might create multiple synonym maps for different languages, such as English and French versions, or lexicons if your content includes technical or obscure terminology. Although you can create multiple synonym maps in your search service, within an index, a field definition can only have one synonym map assignment.
22
22
23
23
A synonym map consists of name, format, and rules that function as synonym map entries. The only format that is supported is `solr`, and the `solr` format determines rule construction.
24
24
@@ -43,7 +43,7 @@ To create a synonym map, do so programmatically (the portal doesn't support syno
43
43
44
44
## Define rules
45
45
46
-
Mapping rules adhere to the open-source synonym filter specification of Apache Solr, described in this document: [SynonymFilter](https://cwiki.apache.org/confluence/display/solr/Filter+Descriptions#FilterDescriptions-SynonymFilter).The `solr` format supports two kinds of rules:
46
+
Mapping rules adhere to the open-source synonym filter specification of Apache Solr, described in this document: [SynonymFilter](https://cwiki.apache.org/confluence/display/solr/Filter+Descriptions#FilterDescriptions-SynonymFilter).The `solr` format supports two kinds of rules:
47
47
48
48
+ equivalency (where terms are equal substitutes in the query)
49
49
@@ -73,7 +73,7 @@ In the equivalence case, a query for `dog` will expand the query to also include
73
73
74
74
Rules for an explicit mapping are denoted by an arrow `=>`. When specified, a term sequence of a search query that matches the left-hand side of `=>` will be replaced with the alternatives on the right-hand side at query time.
75
75
76
-
In the explicit case, a query for `Washington`, `Wash.` or `WA` will be rewritten as `WA`, and the query engine will only look for matches on the term `WA`. Explicit mapping only applies in the direction specified, and does not rewrite the query `WA` to `Washington` in this case.
76
+
In the explicit case, a query for `Washington`, `Wash.` or `WA` will be rewritten as `WA`, and the query engine will only look for matches on the term `WA`. Explicit mapping only applies in the direction specified, and doesn't rewrite the query `WA` to `Washington` in this case.
77
77
78
78
```json
79
79
{
@@ -102,7 +102,7 @@ The following example shows an example of how to escape a character with a backs
102
102
}
103
103
```
104
104
105
-
Since the backslash is itself a special character in other languages like JSON and C#, you will probably need to double-escape it. For example, the JSON sent to the REST API for the above synonym map would look like this:
105
+
Since the backslash is itself a special character in other languages like JSON and C#, you'll probably need to double-escape it. For example, the JSON sent to the REST API for the above synonym map would look like this:
106
106
107
107
```json
108
108
{
@@ -115,7 +115,7 @@ Since the backslash is itself a special character in other languages like JSON a
115
115
116
116
As mentioned previously, you can create or update a synonym map without disrupting query and indexing workloads. A synonym map is a standalone object (like indexes or data sources), and as long as no field is using it, updates won't cause indexing or queries to fail. However, once you add a synonym map to a field definition, if you then delete a synonym map, any query that includes the fields in question will fail with a 404 error.
117
117
118
-
Creating, updating, and deleting a synonym map is always a whole-document operation, meaning that you cannot update or delete parts of the synonym map incrementally. Updating even a single rule requires a reload.
118
+
Creating, updating, and deleting a synonym map is always a whole-document operation, meaning that you can't update or delete parts of the synonym map incrementally. Updating even a single rule requires a reload.
119
119
120
120
## Assign synonyms to fields
121
121
@@ -149,7 +149,7 @@ POST /indexes?api-version=2020-06-30
149
149
150
150
## Query on equivalent or mapped fields
151
151
152
-
Adding synonyms does not impose new requirements on query construction. You can issue term and phrase queries just as you did before the addition of synonyms. The only difference is that if a query term exists in the synonym map, the query engine will either expand or rewrite the term or phrase, depending on the rule.
152
+
Adding synonyms doesn't impose new requirements on query construction. You can issue term and phrase queries just as you did before the addition of synonyms. The only difference is that if a query term exists in the synonym map, the query engine will either expand or rewrite the term or phrase, depending on the rule.
153
153
154
154
## How synonyms are used during query execution
155
155
@@ -159,9 +159,9 @@ For synonym-enabled fields, synonyms are subject to the same text analysis as th
159
159
160
160
Internally, the synonyms feature rewrites the original query with synonyms with the OR operator. For this reason, hit highlighting and scoring profiles treat the original term and synonyms as equivalent.
161
161
162
-
Synonyms apply to freeform text queries only and are not supported for filters, facets, autocomplete, or suggestions. Autocomplete and suggestions are based only on the original term; synonym matches do not appear in the response.
162
+
Synonyms apply to free-form text queries only and aren't supported for filters, facets, autocomplete, or suggestions. Autocomplete and suggestions are based only on the original term; synonym matches don't appear in the response.
163
163
164
-
Synonym expansions do not apply to wildcard search terms; prefix, fuzzy, and regex terms aren't expanded.
164
+
Synonym expansions don't apply to wildcard search terms; prefix, fuzzy, and regex terms aren't expanded.
165
165
166
166
If you need to do a single query that applies synonym expansion and wildcard, regex, or fuzzy searches, you can combine the queries using the OR syntax. For example, to combine synonyms with wildcards for simple query syntax, the term would be `<query> | <query>*`.
Copy file name to clipboardExpand all lines: articles/search/service-create-private-endpoint.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,8 +128,8 @@ In this section, you'll create a new Azure Cognitive Search service with a Priva
128
128
| VM architecture | Accept the default **x64**. |
129
129
| Size | Accept the default **Standard D2S v3**. |
130
130
|**ADMINISTRATOR ACCOUNT**||
131
-
| Username | Enter the user name of the administrator.. |
132
-
| Password | Enter the password. The password must be at least 12 characters long and meet the [defined complexity requirements](../virtual-machines/windows/faq.yml?toc=%2fazure%2fvirtual-network%2ftoc.json#what-are-the-password-requirements-when-creating-a-vm-).|
131
+
| Username | Enter the user name of the administrator. Use an account that's valid for your Azure subscription so that you can sign in to Azure portal from the VM. |
132
+
| Password | Enter the account password. The password must be at least 12 characters long and meet the [defined complexity requirements](../virtual-machines/windows/faq.yml?toc=%2fazure%2fvirtual-network%2ftoc.json#what-are-the-password-requirements-when-creating-a-vm-).|
133
133
| Confirm Password | Reenter password. |
134
134
|**INBOUND PORT RULES**||
135
135
| Public inbound ports | Accept the default **Allow selected ports**. |
@@ -169,9 +169,9 @@ Download and then connect to the virtual machine as follows:
169
169
170
170
1. Select **Connect**. After selecting the **Connect** button, **Connect to virtual machine** opens.
171
171
172
-
1. Select **Download RDP File**. Azure creates a Remote Desktop Protocol (*.rdp*) file and downloads it to your computer.
172
+
1. Select **Download RDP File**. Azure creates a Remote Desktop Protocol (`.rdp`) file and downloads it to your computer.
0 commit comments