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
+38-37Lines changed: 38 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,25 +51,26 @@ A few query capabilities bypass relevance scoring, which makes them incompatible
51
51
52
52
## Set up the query
53
53
54
-
By default, queries do not use semantic ranking. To use semantic ranking, two different parameters may be used. Each parameter supports a different set of scenarios:
54
+
By default, queries don't use semantic ranking. To use semantic ranking, two different parameters may be used. Each parameter supports a different set of scenarios:
55
55
56
56
1. Specify `queryType` as `"semantic"`:
57
57
+[Text search](search-lucene-query-architecture.md) with a simple plain text query. Empty queries result in no semantic ranking being applied to the results.
58
58
+[Hybrid search](hybrid-search-overview.md).
59
-
+[Simple](query-simple-syntax.md) or [full](query-lucene-syntax.md) syntax cannot be used.
59
+
+[Simple](query-simple-syntax.md) or [full](query-lucene-syntax.md) syntax can't be used.
60
60
1. Specify `semanticQuery`:
61
61
+[Text search](search-lucene-query-architecture.md) using the [simple](query-simple-syntax.md) or [full](query-lucene-syntax.md) syntax.
62
62
+[Vector search](vector-search-overview.md).
63
63
+[Hybrid search](hybrid-search-overview.md).
64
-
+ The query specified for `semanticQuery` must be a simple plain text query. Empty queries are not supported.
64
+
+ The query specified for `semanticQuery` must be a plain text query. Empty queries aren't supported.
65
65
66
66
The following table illustrates the supported scenarios depending on which semantic ranking parameter is used:
67
+
67
68
| Semantic Ranker Parameter | Plain text search |[Simple text search syntax](query-simple-syntax.md)|[Full text search syntax](query-lucene-syntax.md)|[Vector search](vector-search-overview.md)|[Hybrid Search](hybrid-search-overview.md)|[Semantic answers](semantic-answers.md) and captions |
68
69
|-|-|-|-|-|-|-|
69
70
| Set "queryType" to "semantic" | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ |
<sup>1</sup> "semanticQuery" is not supported in the portal [search explorer](search-explorer.md).
73
+
<sup>1</sup> "semanticQuery" isn't supported in the portal [search explorer](search-explorer.md).
73
74
74
75
Regardless of the parameter chosen, the index should contain text fields with rich semantic content and a [semantic configuration](semantic-how-to-configure.md).
75
76
@@ -87,7 +88,7 @@ Regardless of the parameter chosen, the index should contain text fields with ri
87
88
88
89
1. Enter a query, such as "historic hotel with good food", and select **Search**.
89
90
90
-
1. Alternatively, select **JSON view** and paste definitions into the query editor. The portal does not support using `"semanticQuery"`, so setting `"queryType"` to `"semantic"` is required:
91
+
1. Alternatively, select **JSON view** and paste definitions into the query editor. The portal doesn't support using `"semanticQuery"`, so setting `"queryType"` to `"semantic"` is required:
91
92
92
93
:::image type="content" source="./media/semantic-search-overview/semantic-portal-json-query.png" alt-text="Screenshot showing JSON query syntax in the Azure portal." border="true":::
93
94
@@ -117,24 +118,24 @@ The following example in this section uses the [hotels-sample-index](search-get-
117
118
118
119
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.
119
120
120
-
```http
121
-
POST https://[search-service-name].search.windows.net/indexes/hotels-sample-index/docs/search?api-version=2024-07-01
122
-
{
123
-
"search": "interesting hotel with restaurant on site and cozy lobby or shared area",
1. Set "search" to a simple plain text query. Since the "queryType" is set to semantic, neither [simple syntax](query-simple-syntax.md) or [full Lucene syntax](query-lucene-syntax.md) are supported. Supplying `*` or an empty string results in no semantic ranking being applied to the query.
138
+
1. Set "search" to a simple plain text query. Since the "queryType" is set to semantic, [simple syntax](query-simple-syntax.md) or [full Lucene syntax](query-lucene-syntax.md)aren't supported. Supplying `*` or an empty string results in no semantic ranking being applied to the query.
138
139
139
140
1. Set "semanticConfiguration" to a [predefined semantic configuration](semantic-how-to-configure.md) that's embedded in your index.
140
141
@@ -154,27 +155,27 @@ If you want to set `"queryType"` to `"semantic"`, paste the following request in
154
155
155
156
1. Send the request to execute the query and return results.
156
157
157
-
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:
158
+
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:
158
159
159
-
```http
160
-
POST https://[search-service-name].search.windows.net/indexes/hotels-sample-index/docs/search?api-version=2024-07-01
161
-
{
162
-
"search": "Description:breakfast",
163
-
"semanticQuery": "interesting hotel with restaurant on site and cozy lobby or shared area",
0 commit comments