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-answers.md
+5-5Lines changed: 5 additions & 5 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: 03/16/2022
11
+
ms.date: 11/02/2022
12
12
---
13
13
14
14
# Return a semantic answer in Azure Cognitive Search
@@ -40,15 +40,15 @@ Answers are returned as an independent, top-level object in the query response p
40
40
41
41
<aname="query-params"></a>
42
42
43
-
## Formulate a query rest for "answers"
43
+
## Formulate a REST query for "answers"
44
44
45
-
The approach for listing fields in priority order has changed, with "semanticConfiguration" replacing "searchFields". If you're currently using searchFields, update your code to the 2021-04-30-Preview API version and use "semanticConfiguration" instead.
45
+
The approach for listing fields in priority order has changed, with "semanticConfiguration" replacing "searchFields". If you're currently using "searchFields", update your code to the 2021-04-30-Preview API version and use "semanticConfiguration" instead.
To return a semantic answer, the query must have the semantic "queryType", "queryLanguage", "semanticConfiguration", and the "answers" parameters. Specifying these parameters doesn't guarantee an answer, but the request must include them for answer processing to occur.
50
50
51
-
The "semanticConfiguration" parameter is crucial to returning a high-quality answer.
51
+
The "semanticConfiguration" parameter is required. It's defined in a search index, and then referenced in a query, as shown below.
52
52
53
53
```json
54
54
{
@@ -68,7 +68,7 @@ The "semanticConfiguration" parameter is crucial to returning a high-quality ans
68
68
69
69
+ "queryLanguage" must be one of the values from the [supported languages list (REST API)](/rest/api/searchservice/preview-api/search-documents#queryLanguage).
70
70
71
-
+ A "semanticConfiguration" determines which string fields provide tokens to the extraction model. The same fields that produce captions also produce answers. See [Configure semantic ranking](semantic-how-to-query-request.md#2---create-a-semantic-configuration) for details.
71
+
+ A "semanticConfiguration" determines which string fields provide tokens to the extraction model. The same fields that produce captions also produce answers. See [Create a semantic configuration](semantic-how-to-query-request.md#2---create-a-semantic-configuration) for details.
72
72
73
73
+ For "answers", parameter construction is `"answers": "extractive"`, where the default number of answers returned is one. You can increase the number of answers by adding a `count` as shown in the above example, up to a maximum of 10. Whether you need more than one answer depends on the user experience of your app, and how you want to render results.
Copy file name to clipboardExpand all lines: articles/search/semantic-how-to-query-request.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ ms.date: 11/01/2022
16
16
> [!IMPORTANT]
17
17
> Semantic search is in public preview under [supplemental terms of use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). It's available through Azure portal, preview REST APIs, and beta SDKs. This feature is billable. See [Availability and pricing](semantic-search-overview.md#availability-and-pricing).
18
18
19
-
In this article, you'll learn how to invoke a semantic ranking algorithm over a result set, promoting the most semantically relevant results to the top of the stack. You'll also get semantic captions (and optionally [semantic answers](semantic-answers.md)), with highlights over the most relevant terms and phrases.
19
+
In this article, you'll learn how to invoke a semantic ranking algorithm over a result set, promoting the most semantically relevant results to the top of the stack. You can also get semantic captions, with highlights over the most relevant terms and phrases, and [semantic answers](semantic-answers.md).
20
20
21
21
There are two main activities to perform:
22
22
@@ -61,7 +61,7 @@ You'll add a semantic configuration to your [index definition](/rest/api/searchs
61
61
62
62
You can add or update a semantic configuration at any time without rebuilding your index. When you issue a query, you'll add the semantic configuration (one per query) that specifies which semantic configuration to use for the query.
63
63
64
-
1. Review the properties you'll need to specify. A semantic configuration has a name and at least one of the following properties:
64
+
1. Review the properties you'll need to specify. A semantic configuration has a name and at least one each of the following properties:
65
65
66
66
+**Title field** - A title field should be a concise description of the document, ideally a string that is under 25 words. This field could be the title of the document, name of the product, or item in your search index. If you don't have a title in your search index, leave this field blank.
67
67
+**Content fields** - Content fields should contain text in natural language form. Common examples of content are the body of a document, the description of a product, or other free-form text.
@@ -71,7 +71,7 @@ You can add or update a semantic configuration at any time without rebuilding yo
71
71
72
72
1. For the above properties, determine which fields to assign.
73
73
74
-
A field must be a [supported data type](/rest/api/searchservice/supported-data-types) and it should contain strings.If you happen to include an invalid field, there's no error, but those fields won't be used in semantic ranking.
74
+
A field must be a [supported data type](/rest/api/searchservice/supported-data-types) and it should contain strings.If you happen to include an invalid field, there's no error, but those fields won't be used in semantic ranking.
75
75
76
76
| Data type | Example from hotels-sample-index |
77
77
|-----------|----------------------------------|
@@ -236,7 +236,7 @@ Your next step is adding parameters to the query request. To be successful, your
236
236
237
237
### [**REST API**](#tab/rest-query)
238
238
239
-
Use the [Search Documents (REST preview)](/rest/api/searchservice/preview-api/search-documents) to formulate the request programmatically.
239
+
Use the [Search Documents (REST preview)](/rest/api/searchservice/preview-api/search-documents) to formulate the request.
240
240
241
241
A response includes an "@search.rerankerScore"" automatically. If you want captions, spelling correction, or answers in the response, add "captions", "speller", or "answers" to the request.
242
242
@@ -298,6 +298,8 @@ The following example in this section uses the [hotels-sample-index](search-get-
298
298
299
299
1. Set ["select"](search-query-odata-select.md) to specify which fields are returned in the response, and "count" to return the number of matches in the index. These parameters improve the quality of the request and readability of the response.
300
300
301
+
1. Send the request to execute the query and return results.
302
+
301
303
### [**.NET SDK**](#tab/dotnet-query)
302
304
303
305
Beta versions of the Azure SDKs include support for semantic search. Because the SDKs are beta versions, there's no documentation or samples, but you can refer to the REST API section above for insights on how the APIs should work.
0 commit comments