nick-boss-tech opened a new pull request, #5009: URL: https://github.com/apache/solr/pull/5009
🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)* https://issues.apache.org/jira/browse/SOLR-18482 A `type: range` facet in the JSON Facet API accepted `limit`, `offset`, `sort`, `prelim_sort`, `overrequest`, `overrefine` and `refine` and silently ignored all of them: the buckets came back the same regardless. The same keys work on terms facets, so users copying them across got a plausible-looking wrong answer. `FacetRange` extends `FacetRequestSorted`, so the fields exist on the request object, but `FacetRangeParser` never read them and `FacetRangeProcessor` never consults them. Following the proposal on the ticket, `FacetRangeParser` now rejects each of these parameters with a 400 naming the parameter, e.g. "sort is not supported on range facets". The parameters are checked in a fixed order so a request carrying several of them fails on the same one every time. The ref guide Range Facet section now states which of the common facet parameters do not apply. **Compatibility change, intentional:** requests that include any of these parameters on a range facet were previously accepted (and the parameters silently dropped); they now return a 400. No new security boundary is added. Tests: cases added to `TestJsonFacetErrors.testRangeFacetsErrorCases` cover each of the seven parameters, the `{range:{...}}` form, the multi-parameter precedence, and a plain range facet as a control. `TestJsonFacetErrors` and `TestJsonRangeFacets` pass (15 tests), Error Prone clean, `:solr:core:check -x test` passes. Changelog: `changelog/unreleased/SOLR-18482-range-facet-unsupported-params.yml` (fixed) ### AI assistance AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution. -- 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]
