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
| Semantic search (captions, highlights, answers) | Standard tier (S1, S2, S3) | North Central US, West US, West US 2, East US 2, North Europe, West Europe | Required |[Cognitive Search pricing page](https://azure.microsoft.com/pricing/details/search/)|
88
-
| Spell check |Any | North Central US, West US, West US 2, East US 2, North Europe, West Europe | Required| None (free) |
87
+
| Semantic search (rank, captions, highlights, answers) | Standard tier (S1, S2, S3) | North Central US, West US, West US 2, East US 2, North Europe, West Europe | Required |[Cognitive Search pricing page](https://azure.microsoft.com/pricing/details/search/)|
88
+
| Spell check |Basic and above | All | None| None (free) |
89
89
90
-
You can use spell check without semantic search, free of charge. Charges for semantic search are levied when query requests include `queryType=semantic` and the search string is not empty (for example, `search=pet friendly hotels in new york`. Empty search (queries where `search=*`) are not charged, even if queryType is set to `semantic`.
90
+
Charges for semantic search are levied when query requests include "queryType=semantic" and the search string is not empty (for example, "search=pet friendly hotels in new york". If your search string is empty ("search=*"), you won't be charged, even if the queryType is set to "semantic".
91
91
92
92
## Disable semantic search
93
93
94
-
Only a search service that has the feature enabled can incur charges. However, if you want full protection against accidental usage, set the [disabled option](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update#searchsemanticsearch).
94
+
For full protection against accidental usage and charges, you can [disable semantic search](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update#searchsemanticsearch) using the Create or Update Service API on your search service. After the feature is disabled, any requests that include the semantic query type will be rejected.
95
95
96
96
* Management REST API version 2021-04-01-Preview provides this option
Copy file name to clipboardExpand all lines: articles/search/speller-how-to-add.md
+28-13Lines changed: 28 additions & 13 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: 05/27/2021
11
+
ms.date: 09/29/2021
12
12
ms.custom: references_regions
13
13
---
14
14
# Add spell check to queries in Cognitive Search
@@ -18,19 +18,27 @@ ms.custom: references_regions
18
18
19
19
You can improve recall by spell-correcting individual search query terms before they reach the search engine. The **speller** parameter is supported for all query types: [simple](query-simple-syntax.md), [full](query-lucene-syntax.md), and the new [semantic](semantic-how-to-query-request.md) option currently in public preview.
20
20
21
+
Speller was released in tandem with the [semantic search preview](semantic-search-overview.md) and shares the queryLanguage parameter, but is otherwise an independent feature with it's own prerequisites. There is no sign-up or additional charges for using this feature.
22
+
21
23
## Prerequisites
22
24
23
-
Speller was released in tandem with the [semantic search preview](semantic-search-overview.md). As such, [sign up](https://aka.ms/SemanticSearchPreviewSignup) is required but there is no charge for using it, and no tier restrictions. Speller is available in the [same regions](semantic-search-overview.md#availability-and-pricing) as semantic search.
25
+
To use spell check, you will need the following:
24
26
25
-
Once sign up is processed, you will need the following:
27
+
+ A search service at Basic tier or above, in any region.
26
28
27
-
+ An existing search index, with content in a [supported language](#supported-languages). Currently, spell correction does not work with [synonyms](search-synonyms.md). Avoid using it on indexes that specify a synonym map in any field definition.
29
+
+ An existing search index with content in a [supported language](#supported-languages).
28
30
29
-
+A search client for sending queries
31
+
+[A query request](/rest/api/searchservice/preview-api/search-documents) that has "speller=lexicon", and "queryLanguage" set to a [supported language](#supported-languages). Spell check works on strings passed in the "search" parameter. It's not supported for filters.
30
32
31
-
The search client must support preview REST APIs on the query request. You can use [Postman](search-get-started-rest.md), [Visual Studio Code](search-get-started-vs-code.md), or code that you've modified to make REST calls to the preview APIs.
33
+
Use a search client that supports preview APIs on the query request. For REST, you can use [Postman](search-get-started-rest.md), [Visual Studio Code](search-get-started-vs-code.md), or code that you've modified to make REST calls to the preview APIs. You can also use beta releases of the Azure SDKs.
32
34
33
-
+[A query request](/rest/api/searchservice/preview-api/search-documents) that invokes spell correction must have "api-version=2020-06-30-Preview", "speller=lexicon", and "queryLanguage" set to a [supported language](#supported-languages).
35
+
| Client library | Versions |
36
+
|----------|----------|
37
+
| REST API |[2021-04-30-Preview](/rest/api/searchservice/index-preview) or 2020-06-30-Preview |
38
+
| Azure SDK for .NET |[version 11.3.0-beta.2](https://www.nuget.org/packages/Azure.Search.Documents/11.3.0-beta.2)|
39
+
| Azure SDK for Java |[version 11.4.0-beta.2](https://search.maven.org/artifact/com.azure/azure-search-documents/11.4.0-beta.2/jar)|
40
+
| Azure SDK for JavaScript |[version 11.2.0-beta.2](https://www.npmjs.com/package/@azure/search-documents/v/11.2.0-beta.2)|
41
+
| Azure SDK for Python |[version 11.2.0b3](https://pypi.org/project/azure-search-documents/11.2.0b3/)|
34
42
35
43
## Spell correction with simple search
36
44
@@ -50,7 +58,7 @@ POST https://[service name].search.windows.net/indexes/hotels-sample-index/docs/
50
58
51
59
## Spell correction with full Lucene
52
60
53
-
Spelling correction occurs on individual query terms that undergo analysis, which is why you can use the speller parameter with some Lucene queries, but not others.
61
+
Spelling correction occurs on individual query terms that undergo text analysis, which is why you can use the speller parameter with some Lucene queries, but not others.
54
62
55
63
+ Incompatible query forms that bypass text analysis include: wildcard, regex, fuzzy
56
64
+ Compatible query forms include: fielded search, proximity, term boosting
@@ -88,26 +96,33 @@ POST https://[service name].search.windows.net/indexes/hotels-sample-index/docs/
88
96
89
97
## Supported languages
90
98
91
-
For spell check valid values for queryLanguage can be found in the following table. This list is a subset of the [supported languages (REST API reference)](/rest/api/searchservice/preview-api/search-documents#queryLanguage). If you are using semantic captions and answers without spell check, you can choose from the larger list of languages and variants.
99
+
Valid values for queryLanguage can be found in the following table, copied from the list of [supported languages (REST API reference)](/rest/api/searchservice/preview-api/search-documents#queryLanguage).
92
100
93
101
| Language | queryLanguage |
94
102
|----------|---------------|
95
103
| English [EN]| EN, EN-US (default) |
96
104
| Spanish [ES]| ES, ES-ES (default)|
97
105
| French [FR]| FR, FR-FR (default) |
98
106
| German [DE]| DE, DE-DE (default) |
107
+
| Dutch [NL]| NL, NL-BE, NL-NL (default) |
108
+
109
+
### queryLanguage considerations
110
+
111
+
As noted elsewhere, a query request can only have one queryLanguage parameter, but that parameter is shared by multiple features, each of which supports a different cohort of languages. If you are just using spell check, the list of supported languages in the above table is the complete list.
112
+
113
+
### Language analyzer considerations
99
114
100
-
## Language considerations
115
+
Indexes that contain non-English content often use [language analyzers](index-add-language-analyzers.md) on non-English fields to apply the linguistic rules of the native language.
101
116
102
-
The queryLanguage parameter required for speller must be consistent with any [language analyzers](index-add-language-analyzers.md) assigned to field definitions in the index. For example, if a field's content was indexed using the "fr.microsoft" language analyzer, then queries, spell check, semantic captions, and semantic answers should all use a French language library of some form.
117
+
If you are now adding spell check to content that also undergoes language analysis, you will achieve better results if you use the same language at every step of indexing and query processing. For example, if a field's content was indexed using the "fr.microsoft" language analyzer, then queries, spell check, semantic captions, and semantic answers should all use a French lexicon or language library of some form.
103
118
104
119
To recap how language libraries are used in Cognitive Search:
105
120
106
-
+ Language analyzers can be invoked during indexing and query execution, and can be either full Lucene (for example, "de.lucene") or Microsoft ("de.microsoft).
121
+
+ Language analyzers can be invoked during indexing and query execution, and are either Apache Lucene (for example, "de.lucene") or Microsoft ("de.microsoft).
107
122
108
123
+ Language lexicons invoked during spell check are specified using one of the language codes in the table above.
109
124
110
-
In a query request, the queryLanguage applies equally to speller, [answers](semantic-answers.md), and captions. There is no override for individual parts of a semantic response.
125
+
In a query request, the value assigned to queryLanguage applies equally to speller, [answers](semantic-answers.md), and captions.
111
126
112
127
> [!NOTE]
113
128
> Language consistency across various property values is only a concern if you are using language analyzers. If you are using language-agnostic analyzers (such as keyword, simple, standard, stop, whitespace, or `standardasciifolding.lucene`), then the queryLanguage value can be whatever you want.
0 commit comments