This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 1ce59fa4f35 Add extra if in pseudocode fetch all docs (#2691)
1ce59fa4f35 is described below
commit 1ce59fa4f35bb3bcbc107ca4aabf93f7275ecc68
Author: lbercken <[email protected]>
AuthorDate: Wed Sep 4 17:32:02 2024 +0200
Add extra if in pseudocode fetch all docs (#2691)
"You can repeat this process until you’ve fetched as many docs as you want,
or until the nextCursorMark returned matches the cursorMark you’ve already
specified — indicating that there are no more results."
The pseudo code misses the first part. The extra if also prevents an
unnecessary extra request.
---
.../modules/query-guide/pages/pagination-of-results.adoc | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/solr/solr-ref-guide/modules/query-guide/pages/pagination-of-results.adoc
b/solr/solr-ref-guide/modules/query-guide/pages/pagination-of-results.adoc
index 1c687869fb1..b96fb459d78 100644
--- a/solr/solr-ref-guide/modules/query-guide/pages/pagination-of-results.adoc
+++ b/solr/solr-ref-guide/modules/query-guide/pages/pagination-of-results.adoc
@@ -144,6 +144,9 @@ $done = false
while (not $done) {
$results = fetch_solr($params)
// do something with $results
+ if (count($results[response][docs]) < $r) {
+ $done = true
+ }
if ($params[cursorMark] == $results[nextCursorMark]) {
$done = true
}