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/search-limits-quotas-capacity.md
+10-4Lines changed: 10 additions & 4 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: azure-ai-search
10
10
ms.topic: conceptual
11
-
ms.date: 12/05/2024
11
+
ms.date: 12/06/2024
12
12
ms.custom:
13
13
- references_regions
14
14
- build-2024
@@ -204,7 +204,7 @@ Static rate request limits for operations related to a service:
204
204
205
205
Total semantic ranker queries per second varies based on the following factors:
206
206
+ The SKU of the search service. Both queue capacity and concurrent request limits vary by SKU.
207
-
+ The number of search units in the search service. The simplest way to increase the maximum number of concurrent semantic ranker queries is to [add additional search units to your search service](search-capacity-planning.md#how-to-change-capacity).
207
+
+ The number of search units in the search service. The simplest way to increase the maximum number of concurrent semantic ranker queries is to [add more search units to your search service](search-capacity-planning.md#how-to-change-capacity).
208
208
+ The total available semantic ranker capacity in the region.
209
209
+ The amount of time it takes to serve a query using semantic ranker. This varies based on how busy the search service is.
210
210
@@ -217,13 +217,17 @@ The following table describes the semantic ranker throttling limits by SKU. Subj
217
217
218
218
## API request limits
219
219
220
-
Limits on payloads and queries exist because unbounded queries can destabilize your search service. Typically, such queries are created programmatically. If your application generates search queries programmatically, we recommend designing it in such a way that it doesn't generate queries of unbounded size. If you must exeed a supported limit, you should [test your workload](search-performance-analysis.md#develop-baseline-numbers) so that you know what to expect.
220
+
Limits on queries exist because unbounded queries can destabilize your search service. Typically, such queries are created programmatically. If your application generates search queries programmatically, we recommend designing it in such a way that it doesn't generate queries of unbounded size.
221
+
222
+
Limits on payloads exist for similar reasons, ensuring the stability of your search service. The limit applies to the entire request, inclusive of all its components. For example, if the request batches several documents or commands, the entire request must fit within the supported limit.
223
+
224
+
If you must exceed a supported limit, you should [test your workload](search-performance-analysis.md#develop-baseline-numbers) so that you know what to expect.
221
225
222
226
Except where noted, the following API requests apply to all programmable interfaces, including the Azure SDKs.
223
227
224
228
General:
225
229
226
-
+ Supported maximum payload limit is 16 MB for indexing and query requests via REST API and SDKs.
230
+
+ Supported maximum payload limit is 16 MB for indexing and query request via REST API and SDKs.
227
231
+ Maximum 8-KB URL length (applies to REST APIs only).
228
232
229
233
Indexing APIs:
@@ -247,6 +251,8 @@ Search terms:
247
251
+ Maximum 1,000 documents returned per page of search results
248
252
+ Maximum 100 suggestions returned per Suggest API request
249
253
254
+
The search engine returns 50 results by default, but you can [override this parameter](search-pagination-page-layout.md#number-of-results-in-the-response) up to the maximum limit.
255
+
250
256
## API key limits
251
257
252
258
API keys are used for service authentication. There are two types. Admin keys are specified in the request header and grant full read-write access to the service. Query keys are read-only, specified on the URL, and typically distributed to client applications.
Copy file name to clipboardExpand all lines: articles/search/search-pagination-page-layout.md
+43-28Lines changed: 43 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
-
title: How to shape search results
2
+
title: Shpae search results
3
3
titleSuffix: Azure AI Search
4
-
description: Define search result composition, get a document count, sort results, and add content navigation to search results in Azure AI Search.
4
+
description: Modify search result composition, get a document count, sort results, and add content navigation to search results in Azure AI Search.
5
5
6
6
manager: nitinme
7
7
author: HeidiSteen
@@ -10,27 +10,38 @@ ms.service: azure-ai-search
10
10
ms.custom:
11
11
- ignite-2023
12
12
ms.topic: how-to
13
-
ms.date: 06/12/2024
13
+
ms.date: 12/06/2024
14
14
---
15
15
16
-
# How to shape results in Azure AI Search
16
+
# Shape search results and modify search results composition
17
17
18
-
This article explains how to work with a query response in Azure AI Search. The structure of a response is determined by parameters in the query itself, as described in [Search Documents (REST)](/rest/api/searchservice/documents/search-post) or [SearchResults Class (Azure for .NET)](/dotnet/api/azure.search.documents.models.searchresults-1).
18
+
This article explains search results composition in Azure AI Search and how to modify results for your scenarios. Search results are returned in a query response. The structure of a response is determined by parameters in the query itself.
19
19
20
-
Parameters on the query determine:
20
+
Search results include top-level fields such as count and semantic ranking-related elements such as `answers`, but the matching documents are a values array.
21
21
22
-
+ Field selection
23
-
+ Count of matches found in the index for the query
24
-
+ Paging
25
-
+ Number of results in the response (up to 50, by default)
26
-
+ Sort order
22
+
For search results composition, parameters on the query determine:
23
+
24
+
+ Number of matches found in the index (`count`)
25
+
+ Number of matches returned in the response (50 by default, through `top`) or per page (`skip` and `top`)
26
+
+ Fields included in search results (`select`)
27
+
+ Sort order (`orderby`)
27
28
+ Highlighting of terms within a result, matching on either the whole or partial term in the body
29
+
+ Whether elements from the semantic ranker are included in the response (semantic ranking is optional)
30
+
31
+
## Clients and APIs for defining the query response
32
+
33
+
+[Search Explorer](search-explorer.md) in the Azure portal, using JSON view so that you can specify any supported parameter
34
+
+[Documents - POST (REST APIs)](/rest/api/searchservice/documents/search-post)
35
+
+[SearchClient.Search Method (Azure SDK for .NET)](/dotnet/api/azure.search.documents.searchclient.search?view=azure-dotnet&preserve-view=true)
36
+
+[SearchClient.Search Method (Azure SDK for Python)](/python/api/azure-search-documents/azure.search.documents.searchclient?view=azure-python#azure-search-documents-searchclient-search&preserve-view=true)
37
+
+[SearchClient.Search Method (Azure for JavaScript)](/javascript/api/@azure/search-documents/searchclient?view=azure-node-latest#@azure-search-documents-searchclient-search&preserve-view=true)
38
+
+[SearchClient.Search Method (Azure for Java)](/java/api/com.azure.search.documents.searchclient?view=azure-java-stable#com-azure-search-documents-searchclient-search(java-lang-string)&preserve-view=true)
28
39
29
40
## Result composition
30
41
31
-
Results are tabular, composed of fields of either all "retrievable" fields, or limited to just those fields specified in the **`$select`** parameters. Rows are the matching documents.
42
+
Results are tabular, composed of fields of either all `retrievable` fields, or limited to just those fields specified in the `select` parameter. Rows are the matching documents.
32
43
33
-
You can choose which fields are in search results. While a search document might have a large number of fields, typically only a few are needed to represent each document in results. On a query request, append `$select=<field list>` to specify which "retrievable" fields should appear in the response.
44
+
You can choose which fields are in search results. While a search document might have a large number of fields, typically only a few are needed to represent each document in results. On a query request, append `select=<field list>` to specify which `retrievable` fields should appear in the response.
34
45
35
46
Pick fields that offer contrast and differentiation among documents, providing sufficient information to invite a clickthrough response on the part of the user. On an e-commerce site, it might be a product name, description, brand, color, size, price, and rating. For the built-in hotels-sample index, it might be the "select" fields in the following example:
36
47
@@ -47,30 +58,34 @@ POST /indexes/hotels-sample-index/docs/search?api-version=2024-07-01
47
58
48
59
Occasionally, query output isn't what you're expecting to see. For example, you might find that some results appear to be duplicates, or a result that *should* appear near the top is positioned lower in the results. When query outcomes are unexpected, you can try these query modifications to see if results improve:
49
60
50
-
+ Change **`searchMode=any`** (default) to **`searchMode=all`** to require matches on all criteria instead of any of the criteria. This is especially true when boolean operators are included the query.
61
+
+ Change `searchMode=any` (default) to `searchMode=all` to require matches on all criteria instead of any of the criteria. This is especially true when boolean operators are included the query.
51
62
52
63
+ Experiment with different lexical analyzers or custom analyzers to see if it changes the query outcome. The default analyzer breaks up hyphenated words and reduces words to root forms, which usually improves the robustness of a query response. However, if you need to preserve hyphens, or if strings include special characters, you might need to configure custom analyzers to ensure the index contains tokens in the right format. For more information, see [Partial term search and patterns with special characters (hyphens, wildcard, regex, patterns)](search-query-partial-matching.md).
53
64
54
65
## Counting matches
55
66
56
-
The count parameter returns the number of documents in the index that are considered a match for the query. To return the count, add **`$count=true`** to the query request. There's no maximum value imposed by the search service. Depending on your query and the content of your documents, the count could be as high as every document in the index.
67
+
The count parameter returns the number of documents in the index that are considered a match for the query. To return the count, add `$count=true` to the query request. There's no maximum value imposed by the search service. Depending on your query and the content of your documents, the count could be as high as every document in the index.
57
68
58
69
Count is accurate when the index is stable. If the system is actively adding, updating, or deleting documents, the count is approximate, excluding any documents that aren't fully indexed.
59
70
60
71
Count won't be affected by routine maintenance or other workloads on the search service. However if you have multiple partitions and a single replica, you could experience short-term fluctuations in document count (several minutes) as the partitions are restarted.
61
72
62
73
> [!TIP]
63
-
> To check indexing operations, you can confirm whether the index contains the expected number of documents by adding `$count=true` on an empty search `search=*` query. The result is the full count of documents in your index.
74
+
> To check indexing operations, you can confirm whether the index contains the expected number of documents by adding `count=true` on an empty search `search=*` query. The result is the full count of documents in your index.
64
75
>
65
-
> When testing query syntax, `$count=true` can quickly tell you whether your modifications are returning greater or fewer results, which can be useful feedback.
76
+
> When testing query syntax, `count=true` can quickly tell you whether your modifications are returning greater or fewer results, which can be useful feedback.
77
+
78
+
<aname="paging-results"></a>
79
+
80
+
## Number of results in the response
66
81
67
-
## Paging results
82
+
The maximum API limit is 1,000 documents. By default, the search engine returns up to the first 50 matches.
68
83
69
-
By default, the search engine returns up to the first 50 matches. The top 50 are determined by search score, assuming the query is full text search or semantic. Otherwise, the top 50 are an arbitrary order for exact match queries (where uniform "@searchScore=1.0" indicates arbitrary ranking).
84
+
The top 50 are determined by search score, assuming the query is full text search or semantic. Otherwise, the top 50 are an arbitrary order for exact match queries (where uniform "@searchScore=1.0" indicates arbitrary ranking).
70
85
71
-
The upper limit is 1,000 documents returned per page of search results, so you can set top to return up to 1000 document in the first result. In newer preview APIs, if you're using a hybrid query, you can [specify maxTextRecallSize](hybrid-search-how-to-query.md#set-maxtextrecallsize-and-countandfacetmode-preview) to return up to 10,000 documents.
86
+
Set `top` to override the default of 50, returning as many as 1,000 documents in the query response. In newer preview APIs, if you're using a hybrid query, you can [specify maxTextRecallSize](hybrid-search-how-to-query.md#set-maxtextrecallsize-and-countandfacetmode-preview) to return up to 10,000 documents.
72
87
73
-
To control the paging of all documents returned in a result set, add `$top` and `$skip` parameters to a GET request, or `top` and `skip` to a POST request. The following list explains the logic.
88
+
To control the paging of all documents returned in a result set, add `top` and `$skip` parameters to a GET request, or `top` and `skip` to a POST request. The following list explains the logic.
74
89
75
90
+ Return the first set of 15 matching documents plus a count of total matches: `GET /indexes/<INDEX-NAME>/docs?search=<QUERY STRING>&$top=15&$skip=0&$count=true`
76
91
@@ -105,7 +120,7 @@ Notice that document 2 is fetched twice. This is because the new document 5 has
105
120
106
121
### Paging through a large number of results
107
122
108
-
Using `$top` and `$skip` allows a search query to page through 100,000 results, but what if results are larger than 100,000? To page through a response this large, use a [sort order](search-query-odata-orderby.md) and [range filter](search-query-odata-comparison-operators.md) as a workaround for `$skip`.
123
+
Using `top` and `skip` allows a search query to page through 100,000 results, but what if results are larger than 100,000? To page through a response this large, use a [sort order](search-query-odata-orderby.md) and [range filter](search-query-odata-comparison-operators.md) as a workaround for `skip`.
109
124
110
125
In this workaround, sort and filter are applied to a document ID field or another field that is unique for each document. The unique field must have `filterable` and `sortable` attribution in the search index.
111
126
@@ -143,15 +158,15 @@ In this workaround, sort and filter are applied to a document ID field or anothe
143
158
1. Pagination ends when the query returns zero results.
144
159
145
160
> [!NOTE]
146
-
> The "filterable" and "sortable" attributes can only be enabled when a field is first added to an index, they cannot be enabled on an existing field.
161
+
> The `filterable` and `sortable` attributes can only be enabled when a field is first added to an index, they cannot be enabled on an existing field.
147
162
148
163
## Ordering results
149
164
150
165
In a full text search query, results can be ranked by:
151
166
152
167
+ a search score
153
168
+ a semantic reranker score
154
-
+ a sort order on a "sortable" field
169
+
+ a sort order on a `sortable` field
155
170
156
171
You can also boost any matches found in specific fields by adding a scoring profile.
157
172
@@ -204,7 +219,7 @@ Hit highlighting instructions are provided on the [query request](/rest/api/sear
204
219
205
220
### Specify highlighting in the request
206
221
207
-
To return highlighted terms, include the "highlight" parameter in the query request. The parameter is set to a comma-delimited list of fields.
222
+
To return highlighted terms, include the highlight parameter in the query request. The parameter is set to a comma-delimited list of fields.
208
223
209
224
By default, the format mark up is `<em>`, but you can override the tag using `highlightPreTag` and `highlightPostTag` parameters. Your client code handles the response (for example, applying a bold font or a yellow background).
210
225
@@ -218,7 +233,7 @@ POST /indexes/good-books/docs/search?api-version=2024-07-01
218
233
}
219
234
```
220
235
221
-
By default, Azure AI Search returns up to five highlights per field. You can adjust this number by appending a dash followed by an integer. For example, `"highlight": "description-10"` returns up to 10 highlighted terms on matching content in the "description" field.
236
+
By default, Azure AI Search returns up to five highlights per field. You can adjust this number by appending a dash followed by an integer. For example, `"highlight": "description-10"` returns up to 10 highlighted terms on matching content in the description field.
222
237
223
238
### Highlighted results
224
239
@@ -230,7 +245,7 @@ In a keyword search, each term is scanned for independently. A query for "divine
230
245
231
246
### Keyword search highlighting
232
247
233
-
Within a highlighted field, formatting is applied to whole terms. For example, on a match against "The Divine Secrets of the Ya-Ya Sisterhood", formatting is applied to each term separately, even though they're consecutive.
248
+
Within a highlighted field, formatting is applied to whole terms. For example, on a match against "The Divine Secrets of the Ya-Ya Sisterhood", formatting is applied to each term separately, even though they're consecutive.
234
249
235
250
```json
236
251
"@odata.count": 39,
@@ -343,4 +358,4 @@ To quickly generate a search page for your client, consider these options:
343
358
344
359
+ [Add search to an ASP.NET Core (MVC) app](tutorial-csharp-create-mvc-app.md) is a tutorial and code sample that builds a functional client.
345
360
346
-
+ [Add search to web apps](tutorial-csharp-overview.md) is a tutorial and code sample that uses the React JavaScript libraries for the user experience. The app is deployed using Azure Static Web Apps.
361
+
+ [Add search to web apps](tutorial-csharp-overview.md) is a C# tutorial and code sample that uses the React JavaScript libraries for the user experience. The app is deployed using Azure Static Web Apps and it implements pagination.
0 commit comments