Solr place upper bound on number of rows to be returned from solr for single
mailbox search When dovecot sends a search to solr it uses the rows parameter.
For multiple mailbox search the value used is SOLR_MAX_MULTI_ROWS , hardcoded to
100000. For single mailbox search the value used is uidnext. This patch
introduces an upper limit for single mailbox search using the same upper bound
as for multiple mailbox searches, SOLR_MAX_MULTI_ROWS, while leaving the
existing functionality of sending the uidnext value if it is smaller. This is
just to place a more reasonable upper bound since uidnext can get much larger
than 100000. The following url points to the Solr documentation for query
parameters that describes the rows parameter:
https://solr.apache.org/guide/solr/latest/query-guide/common-query-parameters.html
str = t_str_new(256);
str_printfa(str, "wt=xml&fl=uid,score&rows=%u&sort=uid+asc&q=%%7b!lucene+q.op%%3dAND%%7d",
- status.uidnext);
+ I_MIN(status.uidnext, SOLR_MAX_MULTI_ROWS));
prefix_len = str_len(str);
if (solr_add_definite_query_args(str, args, and_args)) {