mkhludnev opened a new pull request, #4582: URL: https://github.com/apache/solr/pull/4582
https://issues.apache.org/jira/browse/SOLR-13764 This pull request adds support for the Intervals Query Parser in Solr, enabling users to construct Lucene interval queries using a JSON-based DSL. The changes include the core implementation, integration with the standard query parser plugins, documentation updates, and new tests to ensure distributed and JSON query support. **Intervals Query Parser Implementation and Integration:** * Added the `IntervalsQParserPlugin` to the set of standard query parser plugins in `QParserPlugin.java`, allowing interval queries to be parsed and executed. * Updated `RequestUtil.java` to recognize and correctly handle the new `json_queries` key in JSON requests, ensuring it is passed through for use by query parsers. ** The syntax proposed** ``` ?q={!intervals json_query=q1 df=subject}&json={json_queries:{q1:{match:{query:quick}}}} ``` this QP refers to json.json_queries. I propose to introduce it since I expect more usages for pure json parsing. The considerable alternative is ``` ?q={!intervals param_ref=q1 df=subject}&json={param:{q1:{match:{query:quick}}}} ``` of even `param_ref=$q1` I'm not sure if I can amend existing `$` handling. Propose yours syntax in comments. **Testing and Validation:** * Introduced a new test class, `DistributedQParserTest.java`, which verifies distributed search support for the new `intervals` query parser alongside existing parsers. * Expanded `TestJsonRequest.java` to test the handling and preservation of the `json_queries` key in JSON requests. **Documentation:** * Added a new changelog entry describing the addition of the Intervals Query Parser. * Updated the Solr Reference Guide to document the new query parser and linked its dedicated documentation page in the navigation and parser overview. [[1]](diffhunk://#diff-876cb21fc9406446624005a9763112b6f64fe14294aa2ca5edd75d4d8f30841fR720-R728) [[2]](diffhunk://#diff-567c5a34e45ce2dcd7dd978fad7553d3d561153c86348d850f29310d002b50e1R33) <!-- _(If you are a project committer then you may remove some/all of the following template.)_ Before creating a pull request, please file an issue in the ASF Jira system for Solr: * https://issues.apache.org/jira/projects/SOLR For something minor (i.e. that wouldn't be worth putting in release notes), you can skip JIRA. To create a Jira issue, you will need to create an account there first. The title of the PR should reference the Jira issue number in the form: * SOLR-####: <short description of problem or changes> SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on. Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. --> # Checklist Please review the following and check all that apply: - [v] 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. - [v] I have created a Jira issue and added the issue ID to my pull request title. - [v] 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) - [v] I have developed this patch against the `main` branch. - [v] I have run `./gradlew check`. - [v] I have added tests for my changes. - [v] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide) - [v] 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]
