Skip to content

Commit 1dc7c09

Browse files
Merge pull request #1870 from HeidiSteen/heidist-uuf
[azure search] CSX requests for clarification on API limits, plus refresh of search …
2 parents 018865b + ef9367c commit 1dc7c09

File tree

2 files changed

+53
-32
lines changed

2 files changed

+53
-32
lines changed

articles/search/search-limits-quotas-capacity.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: HeidiSteen
88
ms.author: heidist
99
ms.service: azure-ai-search
1010
ms.topic: conceptual
11-
ms.date: 12/05/2024
11+
ms.date: 12/06/2024
1212
ms.custom:
1313
- references_regions
1414
- build-2024
@@ -204,7 +204,7 @@ Static rate request limits for operations related to a service:
204204

205205
Total semantic ranker queries per second varies based on the following factors:
206206
+ 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).
208208
+ The total available semantic ranker capacity in the region.
209209
+ The amount of time it takes to serve a query using semantic ranker. This varies based on how busy the search service is.
210210

@@ -217,13 +217,17 @@ The following table describes the semantic ranker throttling limits by SKU. Subj
217217

218218
## API request limits
219219

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.
221225

222226
Except where noted, the following API requests apply to all programmable interfaces, including the Azure SDKs.
223227

224228
General:
225229

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.
227231
+ Maximum 8-KB URL length (applies to REST APIs only).
228232

229233
Indexing APIs:
@@ -247,6 +251,8 @@ Search terms:
247251
+ Maximum 1,000 documents returned per page of search results
248252
+ Maximum 100 suggestions returned per Suggest API request
249253

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+
250256
## API key limits
251257

252258
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.

articles/search/search-pagination-page-layout.md

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: How to shape search results
2+
title: Shpae search results
33
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.
55

66
manager: nitinme
77
author: HeidiSteen
@@ -10,27 +10,38 @@ ms.service: azure-ai-search
1010
ms.custom:
1111
- ignite-2023
1212
ms.topic: how-to
13-
ms.date: 06/12/2024
13+
ms.date: 12/06/2024
1414
---
1515

16-
# How to shape results in Azure AI Search
16+
# Shape search results and modify search results composition
1717

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.
1919

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.
2121

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`)
2728
+ 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)
2839

2940
## Result composition
3041

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.
3243

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.
3445

3546
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:
3647

@@ -47,30 +58,34 @@ POST /indexes/hotels-sample-index/docs/search?api-version=2024-07-01
4758

4859
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:
4960

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.
5162

5263
+ 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).
5364

5465
## Counting matches
5566

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.
5768

5869
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.
5970

6071
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.
6172

6273
> [!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.
6475
>
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+
<a name="paging-results"></a>
79+
80+
## Number of results in the response
6681

67-
## Paging results
82+
The maximum API limit is 1,000 documents. By default, the search engine returns up to the first 50 matches.
6883

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).
7085

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.
7287

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.
7489

7590
+ 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`
7691

@@ -105,7 +120,7 @@ Notice that document 2 is fetched twice. This is because the new document 5 has
105120

106121
### Paging through a large number of results
107122

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`.
109124

110125
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.
111126

@@ -143,15 +158,15 @@ In this workaround, sort and filter are applied to a document ID field or anothe
143158
1. Pagination ends when the query returns zero results.
144159
145160
> [!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.
147162
148163
## Ordering results
149164
150165
In a full text search query, results can be ranked by:
151166
152167
+ a search score
153168
+ a semantic reranker score
154-
+ a sort order on a "sortable" field
169+
+ a sort order on a `sortable` field
155170
156171
You can also boost any matches found in specific fields by adding a scoring profile.
157172
@@ -204,7 +219,7 @@ Hit highlighting instructions are provided on the [query request](/rest/api/sear
204219
205220
### Specify highlighting in the request
206221
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.
208223
209224
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).
210225
@@ -218,7 +233,7 @@ POST /indexes/good-books/docs/search?api-version=2024-07-01
218233
}
219234
```
220235

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.
222237

223238
### Highlighted results
224239

@@ -230,7 +245,7 @@ In a keyword search, each term is scanned for independently. A query for "divine
230245

231246
### Keyword search highlighting
232247

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.
234249

235250
```json
236251
"@odata.count": 39,
@@ -343,4 +358,4 @@ To quickly generate a search page for your client, consider these options:
343358

344359
+ [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.
345360

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

Comments
 (0)