You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ma...@apache.org on 2022/05/03 20:16:28 UTC
[solr] branch branch_9_0 updated: SOLR-16176: Never apply facet overrequest in the case where limit:-1 (#830)
This is an automated email from the ASF dual-hosted git repository.
magibney pushed a commit to branch branch_9_0
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9_0 by this push:
new 4369711bc99 SOLR-16176: Never apply facet overrequest in the case where limit:-1 (#830)
4369711bc99 is described below
commit 4369711bc9931f2271fbcfd2ebfc8be2bc4c5868
Author: Michael Gibney <mi...@michaelgibney.net>
AuthorDate: Tue May 3 15:48:00 2022 -0400
SOLR-16176: Never apply facet overrequest in the case where limit:-1 (#830)
(cherry picked from commit 0bb630b9c86f6a7a17a436c2957da473d52e36ab)
---
.../FacetFieldProcessorByEnumTermsStream.java | 24 +++++++++++++---------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByEnumTermsStream.java b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByEnumTermsStream.java
index c36449d79a2..fe7421ffe2a 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByEnumTermsStream.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByEnumTermsStream.java
@@ -153,16 +153,20 @@ class FacetFieldProcessorByEnumTermsStream extends FacetFieldProcessor implement
bucketsToSkip = freq.offset;
effectiveLimit = freq.limit;
- if (freq.overrequest < -1) {
- // other negative values are not supported
- throw new IllegalArgumentException("Illegal `overrequest` specified: " + freq.overrequest);
- } else if (freq.overrequest > 0 && (fcontext.isShard() || null != resort)) {
- // NOTE: "index sort" _never_ applies a default overrequest. In both the shard case and the
- // resort case, the default overrequest is `0`. However, if `overrequest` is explicitly
- // specified, we respect it except for non-distrib, no-resort request. Overrequest is relevant
- // for the `resort` case; but it can also be relevant in some edge cases of the "shard" case,
- // where it can affect the behavior of `isBucketComplete()` (see SOLR-14595).
- effectiveLimit += freq.overrequest;
+ if (freq.limit >= 0) {
+ // TODO: consider only applying overrequest for `freq.limit > 0` (as opposed to `>=`)?
+ // corresponding change should be made in overrequest logic for `FacetFieldProcessor`.
+ if (freq.overrequest < -1) {
+ // other negative values are not supported
+ throw new IllegalArgumentException("Illegal `overrequest` specified: " + freq.overrequest);
+ } else if (freq.overrequest > 0 && (fcontext.isShard() || null != resort)) {
+ // NOTE: "index sort" _never_ applies a default overrequest. In both the shard case and the
+ // resort case, the default overrequest is `0`. However, if `overrequest` is explicitly
+ // specified, we respect it except for non-distrib, no-resort request. Overrequest is
+ // relevant for the `resort` case; but it can also be relevant in some edge cases of the
+ // "shard" case, where it can affect the behavior of `isBucketComplete()` (see SOLR-14595).
+ effectiveLimit += freq.overrequest;
+ }
}
createAccs(-1, 1);