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-pagination-page-layout.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Results are tabular, composed of fields of either all "retrievable" fields, or l
32
32
33
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.
34
34
35
-
Pick fields that offer contrast and differentiation among documents, providing sufficient information to invite a click-through 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:
35
+
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
36
37
37
```http
38
38
POST /indexes/hotels-sample-index/docs/search?api-version=2024-07-01
@@ -55,7 +55,7 @@ Occasionally, query output isn't what you're expecting to see. For example, you
55
55
56
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.
57
57
58
-
Count is accurate when the index is stable. If the system is actively adding, updating, or deleting documents, the count will be approximate, excluding any documents that aren't fully indexed.
58
+
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
59
60
60
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
61
@@ -70,7 +70,7 @@ By default, the search engine returns up to the first 50 matches. The top 50 are
70
70
71
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.
72
72
73
-
To control the paging of all documents returned in a result set, add `$top` and `$skip` parameters to the GET query request, or `top` and `skip` to the POST query request. The following list explains the logic.
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.
74
74
75
75
+ 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
76
@@ -120,15 +120,15 @@ In this workaround, sort and filter are applied to a document ID field or anothe
120
120
}
121
121
```
122
122
123
-
1. Choose the last result returned by the search query. An example result with only an "id" value is shown here.
123
+
1. Choose the last result returned by the search query. An example result with only an ID value is shown here.
124
124
125
125
```json
126
126
{
127
127
"id": "50"
128
128
}
129
129
```
130
130
131
-
1. Use that "id" value in a range query to fetch the next page of results. This "id" field should have unique values, otherwise pagination may include duplicate results.
131
+
1. Use that ID value in a range query to fetch the next page of results. This ID field should have unique values, otherwise pagination might include duplicate results.
132
132
133
133
```http
134
134
POST /indexes/good-books/docs/search?api-version=2024-07-01
@@ -181,7 +181,7 @@ String fields (`Edm.String`, `Edm.ComplexType` subfields) are sorted in either [
181
181
182
182
+ Numeric content in string fields is sorted alphabetically (1, 10, 11, 2, 20).
183
183
184
-
+ Upper case strings are sorted ahead of lower case (APPLE, Apple, BANANA, Banana, apple, banana). You can assign a [text normalizer](search-normalizers.md) to preprocess the text before sorting to change this behavior. Using the lowercase tokenizer on a field will have no effect on sorting behavior because Azure AI Search sorts on a non-analyzed copy of the field.
184
+
+ Upper case strings are sorted ahead of lower case (APPLE, Apple, BANANA, Banana, apple, banana). You can assign a [text normalizer](search-normalizers.md) to preprocess the text before sorting to change this behavior. Using the lowercase tokenizer on a field has no effect on sorting behavior because Azure AI Search sorts on a nonanalyzed copy of the field.
185
185
186
186
+ Strings that lead with diacritics appear last (Äpfel, Öffnen, Üben)
187
187
@@ -193,7 +193,7 @@ Another approach that promotes order consistency is using a [custom scoring prof
193
193
194
194
Hit highlighting refers to text formatting (such as bold or yellow highlights) applied to matching terms in a result, making it easy to spot the match. Highlighting is useful for longer content fields, such as a description field, where the match isn't immediately obvious.
195
195
196
-
Notice that highlighting is applied to individual terms. There's no highlight capability for the contents of an entire field. If you want to highlight over a phrase, you'll have to provide the matching terms (or phrase) in a quote-enclosed query string. This technique is described further on in this section.
196
+
Notice that highlighting is applied to individual terms. There's no highlight capability for the contents of an entire field. If you want to highlight over a phrase, you have to provide the matching terms (or phrase) in a quote-enclosed query string. This technique is described further on in this section.
197
197
198
198
Hit highlighting instructions are provided on the [query request](/rest/api/searchservice/documents/search-post). Queries that trigger query expansion in the engine, such as fuzzy and wildcard search, have limited support for hit highlighting.
199
199
@@ -224,7 +224,7 @@ By default, Azure AI Search returns up to five highlights per field. You can adj
224
224
225
225
When highlighting is added to the query, the response includes an "@search.highlights" for each result so that your application code can target that structure. The list of fields specified for "highlight" are included in the response.
226
226
227
-
In a keyword search, each term is scanned for independently. A query for "divine secrets" will return matches on any document containing either term.
227
+
In a keyword search, each term is scanned for independently. A query for "divine secrets" returns matches on any document containing either term.
228
228
229
229
:::image type="content" source="media/search-pagination-page-layout/highlighting-example.png" alt-text="Screenshot of highlighting over a phrase query." border="true":::
Copy file name to clipboardExpand all lines: articles/search/search-query-simple-examples.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,13 +119,13 @@ Uniform scores of *1.0* occur when there's no rank, either because the search wa
119
119
120
120
## Example 2: Look up by ID
121
121
122
-
When returning search results in a query, a logical next step is to provide a details page that includes more fields from the document. This example shows you how to return a single document using [Get Document](/rest/api/searchservice/documents/get) by passing in the document ID.
122
+
After search results are returned, a logical next step is to provide a details page that includes more fields from the document. This example shows you how to return a single document using [Get Document](/rest/api/searchservice/documents/get) by passing in the document ID.
123
123
124
124
```http
125
125
GET /indexes/hotels-sample-index/docs/41?api-version=2024-07-01
126
126
```
127
127
128
-
All documents have a unique identifier. If you're using the portal, select the index from the **Indexes** tab and then look at the field definitions to determine which field is the key. Using REST, the [Get Index](/rest/api/searchservice/indexes/get) call returns the index definition in the response body.
128
+
All documents have a unique identifier. If you're using the portal, select the index from the **Indexes** tab and then look at the field definitions to determine which field is the key. In the REST API, the [GET Index](/rest/api/searchservice/indexes/get) call returns the index definition in the response body.
129
129
130
130
The response for the preceding query consists of the document whose key is *41*. Any field that is marked as *retrievable* in the index definition can be returned in search results and rendered in your app.
131
131
@@ -169,7 +169,7 @@ The response for the preceding query consists of the document whose key is *41*.
169
169
170
170
## Example 3: Filter on text
171
171
172
-
[Filter syntax](search-query-odata-filter.md) is an OData expression that you can use by itself or with `search`. Used together, `filter` is applied first to the entire index, and then the search is performed on the results of the filter. Filters can therefore be a useful technique to improve query performance since they reduce the set of documents that the search query needs to process.
172
+
[Filter syntax](search-query-odata-filter.md) is an OData expression that you can use by itself or with `search`. When used together in the same request, `filter` is applied first to the entire index, and then the `search` is performed on the results of the filter. Filters can therefore be a useful technique to improve query performance since they reduce the set of documents that the search query needs to process.
173
173
174
174
Filters can be defined on any field marked as `filterable` in the index definition. For hotels-sample-index, filterable fields include *Category*, *Tags*, *ParkingIncluded*, *Rating*, and most *Address* fields.
175
175
@@ -414,7 +414,7 @@ In a Boolean search, consider adding the `searchMode` parameter as a mechanism f
414
414
415
415
In the context of a Boolean search, the default `"searchMode": "any"` can be confusing if you're stacking a query with multiple operators and getting broader instead of narrower results. This is particularly true with NOT, where results include all documents *not containing* a specific term or phrase.
416
416
417
-
The following example provides an illustration. The query looks for matches on *restaurant* that exclude the phrase *air conditioning*. Running the following query with searchMode (any), 43 documents are returned: those containing the term *restaurant*, plus all documents that *don't* have the phrase *air conditioning.
417
+
The following example provides an illustration. The query looks for matches on *restaurant* that exclude the phrase *air conditioning*. If you run the following query with searchMode (any), 43 documents are returned: those containing the term *restaurant*, plus all documents that *don't* have the phrase *air conditioning.
418
418
419
419
Notice that there's no space between the boolean operator (`-`) and the phrase *air conditioning*. The quotation marks are escaped (`\"`).
0 commit comments