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: modules/search/pages/search-request-params.adoc
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,8 +132,7 @@ To turn on document relevancy scoring in search results, remove the `score` prop
132
132
133
133
|[[search_after]]search_after |Array |No a|
134
134
135
-
NOTE: If you use `search_after` in a search request, you can't use `search_before`.
136
-
Both properties are included in the example code to show the correct syntax.
135
+
NOTE: If you use `search_after` in a search request, you cannot use `search_before`. Both properties are included in the example code to show the correct syntax.
137
136
138
137
Use `search_after` with `from/offset` and `sort` to control pagination in search results.
139
138
@@ -145,15 +144,13 @@ Only result relevancy score values can be entered as strings in the array.
145
144
146
145
The Search Service starts search result pagination after the document with the values you provide in the array.
147
146
148
-
For example, if you had a set of 10 documents to sort based on `_id` values of 1-10, with `from` set to `2` and `search_after` set to `8`, documents 9-10 appear on the same page.
147
+
Use `search_after` to make the memory requirements of deeper page searches more manageable, when compared to using only `from/offset`.
148
+
`search_after` lets you start your search results from a specific result, rather than needing to process a number of search results to skip.
149
149
150
150
To reduce the resource costs of deeper pagination on your Search queries, try to always include your document ID values as the final sort criteria in your <<sort_arr,sort array>>.
151
151
Set the `search_after` property to include the values from the last result on your previous page of search results to effectively paginate.
152
152
153
-
|[[search_before]]search_before |Array |No a|
154
-
155
-
NOTE: If you use `search_before` in a search request, you can't use `search_after`.
156
-
Both properties are included in the example code to show the correct syntax.
153
+
NOTE: If you use `search_before` in a search request, you cannot use `search_after`. Both properties are included in the example code to show the correct syntax.
157
154
158
155
Use `search_before` with `from/offset` and `sort` to control pagination in search results.
159
156
@@ -2249,6 +2246,8 @@ The following `sort` object orders search results by the values in `field1`, the
TIP: For the best results with sorting and page navigation in search results, always include your document ID values (`_id` or `-_id`) as the final sort criteria in your `sort` object.
2250
+
2252
2251
This means that if 2 documents have the same value in `field1`, then the Search Service will sort them again based on their `field2` values.
2253
2252
If they have the same value in `field2`, then sorting will happen again based on each document's score, and then finally the documents' ID values.
0 commit comments