Skip to content

Commit a38b065

Browse files
committed
[NO ISSUE] Straightening out lots of merge conflicts and inconsistencies in search-request-params
1 parent 5fad9ea commit a38b065

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

modules/search/pages/search-request-params.adoc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,24 +138,32 @@ Use `search_after` with `from/offset` and `sort` to control pagination in search
138138

139139
Give a value for each string or JSON object in the <<sort_arr,sort array>> to the `search_after` array.
140140
You must provide the values in the same order that they appear in the <<sort_arr,sort array>>.
141+
Your `sort` array must force a total order on your search results.
142+
141143
Values in the `search_after` array must be strings.
142144
You cannot use `search_after` with numbers or other field data types - if your `sort` array includes fields with a `date` or `number` type, you cannot use `search_after`.
143145
Only result relevancy score values can be entered as strings in the array.
144146

145147
The Search Service starts search result pagination after the document with the values you provide in the array.
146148

147-
Use `search_after` to make the memory requirements of deeper page searches more manageable, when compared to using only `from/offset`.
149+
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.
150+
151+
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` array.
152+
Set the `search_after` property to include the values from the last result on your previous page of search results to effectively paginate.
153+
154+
Use `search_after` to make the memory requirements of deeper page searches more manageable, when compared to using only `from`/`offset`.
148155
`search_after` lets you start your search results from a specific result, rather than needing to process a number of search results to skip.
149156

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-
Set the `search_after` property to include the values from the last result on your previous page of search results to effectively paginate.
157+
|[[search_before]]search_before |Array |No a|
152158

153159
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.
154160

155161
Use `search_before` with `from/offset` and `sort` to control pagination in search results.
156162

157-
Give a value for each string or JSON object in the `sort` array to the `search_before` array.
163+
Give a value for each string or JSON object in the <<sort_arr,sort array>> to the `search_before` array.
158164
You must provide the values in the same order that they appear in the `sort` array.
165+
Your `sort` array must force a total order on your search results.
166+
159167
Values in the `search_before` array must be strings.
160168
You cannot use `search_before` with numbers or other field data types - if your `sort` array includes fields with a `date` or `number` type, you cannot use `search_before`.
161169
Only result relevancy score values can be entered as strings in the array.
@@ -164,9 +172,12 @@ The Search Service starts search result pagination before the document with the
164172

165173
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_before` set to `8`, documents 2-6 appear on the same page.
166174

167-
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>>.
175+
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` array.
168176
Set the `search_before` property to include the values from the last result on your previous page of search results to effectively paginate.
169177

178+
Use `search_before` to make the memory requirements of deeper page searches more manageable, when compared to using only `from`/`offset`.
179+
`search_before` lets you start your search results back from a specific result, rather than needing to process a number of search results to skip.
180+
170181
|[[collections]]collections |Array |No |Contains an array of strings that specify the collections where you want to run the query.
171182

172183
|====

0 commit comments

Comments
 (0)