janhoy commented on code in PR #5009:
URL: https://github.com/apache/solr/pull/5009#discussion_r4189980661
##########
solr/solr-ref-guide/modules/query-guide/pages/json-facet-api.adoc:
##########
@@ -407,6 +407,10 @@ By default, the ranges used to compute range faceting
between `start` and `end`
Refer <<Arbitrary Range>>
|===
+The range facet does not support the `limit`, `offset`, `sort`, `prelim_sort`,
`overrequest`, `overrefine`, or `refine` parameters that terms facets accept.
+Using any of them in a range facet is rejected with a 400 error naming the
parameter.
Review Comment:
Unnecessary line
```suggestion
```
##########
solr/core/src/java/org/apache/solr/search/facet/FacetRangeParser.java:
##########
@@ -23,6 +23,13 @@
import org.apache.solr.search.SyntaxError;
class FacetRangeParser extends FacetParser<FacetRange> {
+
+ // Terms-facet parameters that have no effect on range facets. They used to
be silently
+ // ignored; now they are rejected so users notice the mistake (SOLR-18482).
The order is
+ // fixed so the error names the same parameter when several are present.
+ private static final List<String> UNSUPPORTED_PARAMS =
+ List.of("limit", "offset", "sort", "prelim_sort", "overrequest",
"overrefine", "refine");
Review Comment:
It would be far better if **any** illegal or mis-spelled facet parameter
would cause a HTTP 400. Why would we want to silently accept `"foo":"bar"` in
any request to Solr? This is a bit out of scope for the exact JIRA I filed. But
perhaps we should consider whether it is an easy feat to implement this? Have
not looked closely into the JSON DSL request parsing...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]