umut-sar opened a new pull request, #4441: URL: https://github.com/apache/solr/pull/4441
https://issues.apache.org/jira/browse/SOLR-18246 # Description This PR fixes handling of multiple `facet.field` parameters in the Solr Admin UI query screen. Previously, the UI only provided a single `facet.field` input. When multiple facet fields were entered, the generated request could contain them as a single comma-separated parameter value, for example: ```text facet.field=foo,bar ``` Solr treats this as one facet field value instead of two separate `facet.field` parameters. The expected request format is: ```text facet.field=foo&facet.field=bar ``` The same problem can also occur when using the raw parameters area: multiple `facet.field` values can be entered there, but the resulting facet parameters are still built incorrectly. In addition, the dedicated `facet.field` input should support multiple facet fields directly, without requiring users to rely on raw parameters for this common use case. # Solution This PR updates the Admin UI query screen to handle multiple `facet.field` values explicitly. The changes include: - Adding a `facetFields` model and initializing it with a default entry - Parsing `facet.field` from the URL, supporting both array and scalar values - Rendering repeatable `facet.field` inputs with add/remove controls - Including all configured `facet.field` values when building the query parameters This ensures that multiple facet fields are sent as repeated `facet.field` parameters instead of a single comma-separated value. # Tests I manually tested the Admin UI query screen with faceting enabled. Tested scenarios: - Querying with a single `facet.field` - Querying with multiple `facet.field` values - Adding and removing `facet.field` inputs in the UI - Loading existing query URLs containing one or more `facet.field` parameters - Verifying that the generated request contains repeated `facet.field` parameters, for example: ```text facet.field=foo&facet.field=bar ``` and not: ```text facet.field=foo,bar ``` # Checklist Please review the following and check all that apply: - [x] I have reviewed the guidelines for [How to Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my code conforms to the standards described there to the best of my ability. - [x] I have created a Jira issue and added the issue ID to my pull request title. - [x] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation) - [x] I have developed this patch against the `main` branch. - [x] I have run `./gradlew check`. - [ ] I have added tests for my changes. - [ ] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide) - [ ] I have added a [changelog entry](https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc) for my change -- 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]
