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/semantic-how-to-query-request.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,9 +53,7 @@ A few query capabilities bypass relevance scoring, which makes them incompatible
53
53
54
54
By default, queries don't use semantic ranking. To use semantic ranking, two different parameters can be used. Each parameter supports a different set of scenarios.
55
55
56
-
Semantic queries, whether specified through `search` plus `queryType`, or through `semanticQuery`, must be plain text.
57
-
58
-
Semantic queries can't be empty. Empty queries result in no semantic ranking being applied to the results.
56
+
Semantic queries, whether specified through `search` plus `queryType`, or through `semanticQuery`, must be plain text and they can't be empty. Empty queries result in no semantic ranking being applied to the results.
59
57
60
58
<!--
61
59
1. Set `queryType` to `semantic`:
@@ -70,8 +68,8 @@ Semantic queries can't be empty. Empty queries result in no semantic ranking bei
70
68
71
69
| Semantic ranker parameter |[Plain text search](search-query-create.md)|[Simple text search syntax](query-simple-syntax.md)|[Full text search syntax](query-lucene-syntax.md)|[Vector search](vector-search-how-to-query.md)|[Hybrid Search](hybrid-search-how-to-query.md)|[Semantic answers](semantic-answers.md) and captions |
<sup>1</sup> `queryType=semantic` can't support explicit `simple` or `full` values because the `queryType` parameter is being used for `semantic`. The effective query behaviors are the defaults of the simple parser.
77
75
@@ -119,7 +117,9 @@ Use [Search Documents](/rest/api/searchservice/documents/search-post) to formula
119
117
120
118
A response includes an `@search.rerankerScore` automatically. If you want captions or answers in the response, enable semantic ranking by setting `queryType` to `semantic` or setting `semanticQuery` and adding captions and answers to the request.
121
119
122
-
The following example in this section uses the [hotels-sample-index](search-get-started-portal.md) to demonstrate semantic ranking with semantic answers and captions.
120
+
The following examples in this section uses the [hotels-sample-index](search-get-started-portal.md) to demonstrate semantic ranking with semantic answers and captions.
121
+
122
+
#### Use queryType=semantic
123
123
124
124
If you want to set `queryType` to `semantic`, paste the following request into a web client as a template. Replace `search-service-name` with your search service name and replace `hotels-sample-index` if you have a different index name.
125
125
@@ -160,6 +160,8 @@ POST https://[search-service-name].search.windows.net/indexes/hotels-sample-inde
160
160
161
161
1. Send the request to execute the query and return results.
162
162
163
+
#### Use semanticQuery
164
+
163
165
If you want to use "semanticQuery" in order to use [vector search](vector-search-overview.md), [simple text syntax](query-simple-syntax.md), or [full text syntax](query-lucene-syntax.md), adjust your request to the following JSON:
164
166
165
167
```http
@@ -176,13 +178,12 @@ POST https://[search-service-name].search.windows.net/indexes/hotels-sample-inde
1. Set `queryType` to the search syntax you're using, either [simple](query-simple-syntax.md) or [full](query-lucene-syntax.md).
182
184
183
185
1. Set `semanticQuery` to the simple plain text query you want to use for semantic ranking. Empty queries aren't supported.
184
186
185
-
186
187
### [**.NET SDK**](#tab/dotnet-query)
187
188
188
189
Use QueryType or SemanticQuery to invoke semantic ranker on a semantic query. The [following example](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/samples/Sample08_SemanticSearch.md) is from the Azure SDK team.
0 commit comments