Skip to content

SOLR-13309: Add DoubleRangeField exposing Lucene 'DoubleRange'#4239

Open
gerlowskija wants to merge 1 commit intoapache:mainfrom
gerlowskija:SOLR-13309-double-range-field
Open

SOLR-13309: Add DoubleRangeField exposing Lucene 'DoubleRange'#4239
gerlowskija wants to merge 1 commit intoapache:mainfrom
gerlowskija:SOLR-13309-double-range-field

Conversation

@gerlowskija
Copy link
Contributor

https://issues.apache.org/jira/browse/SOLR-13309

Description

We have made changes recently to expose Lucene's IntRange, LongRange, and FloatRange field, but Solr still lacks coverage for DoubleRange.

This PR adds the DoubleRangeField field type to expose DoubleRange. When merged, we'll have support for all of Lucene's "numeric range" field offerings!

Solution

This PR takes a nearly identical approach to that seen recently in #4229, which introduced FloatRangeField. The primary differences is that this PR uses 'double'/'Double' instead of 'float'/'Float', and that this PR is actually a good deal simpler as it's able to rely on groundwork already laid in the previous #4229.

For those without context on 4229, the overview is that:

  • DoubleRangeField is new field type that extends AbstractNumericRangeField for most common plumbing.
  • Unit tests available in DoubleRangeFieldTest
  • Integration tests available in NumericRangeQParserPluginDoubleTest
  • Small documentation tweaks required in otherparsers.adoc and field-types-included-with-solr.adoc.

Since this PR is so substantially similar to #4229, I was able to use Claude code to generate the tests and DoubleRangeField class.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide
  • I have added a changelog entry for my change

Mirrors recently added 'IntRangeField', 'LongRangeField', and
'FloatRangeField' types, and completes our coverage for Lucene's "range"
field types.
@gerlowskija
Copy link
Contributor Author

In self-reviewing, I got a ton of mileage out of using vimdiff or diff to compare related files.

e.g. vimdiff <snip>/NumericRangeQParserPluginDoubleTest.java <snip>/NumericRangeQParserPluginFloatTest.java should show that the classes are identical except for changes from float -> double.

Feel free to ignore, but I found it helpful 🤷

@github-actions github-actions bot added documentation Improvements or additions to documentation tests cat:search cat:schema labels Mar 25, 2026
@gerlowskija gerlowskija changed the title SOLR-13309: Add DoubleRangeField exposing Lucene 'FloatRange' SOLR-13309: Add DoubleRangeField exposing Lucene 'DoubleRange' Mar 25, 2026
@gerlowskija gerlowskija marked this pull request as ready for review March 25, 2026 15:45
@gerlowskija
Copy link
Contributor Author

Leaving a note to myself here that tests and check both pass locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:schema cat:search documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant