Skip to content

Commit efca456

Browse files
authored
SOLR-13309: Add IntRangeField for Lucenes IntRange (#4141)
This commit adds a new field type, IntRangeField, that can be used to hold singular or multi-dimensional (up to 4) ranges of integers. Field values are represented using brackets and the "TO" operator, with commas used to delimit dimensions (when a particular field is defined as having more than 1 dimension), e.g. [-1 TO 5] [1,2 TO 5,10] [1 TO 1] IntRangeField does not support docValues or uninversion, meaning it's primarily only used for querying. The field can be stored and returned in search-results. Searches on these range-fields rely on a new QParserPlugin implementation, {!numericRange}, which supports "intersects", "crosses", "within", and "contains" semantics via a "criteria" local param. e.g. - {!numericRange field=price_range criteria=within}[1 TO 5] Matches docs whose 'price_range' field falls fully within [1 TO 5]. A doc with [2 TO 3] would match; [3 TO 6] or [8 TO 10] would not. - {!numericRange field=price_range criteria=crosses}[1,10 TO 5,20] Matches docs whose 'price_range' field is partially but not fully contained within [1,10 TO 5,20]. A doc with [2,11 TO 6,21] would match, but [3,11 TO 5,19] would not. This syntax is experimental and may change in the future.
1 parent 4120c70 commit efca456

12 files changed

Lines changed: 1692 additions & 1 deletion

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
2+
title: Introduce new `IntRangeField` field type and (experimental) `{!numericRange}` query parser for storing and querying integer ranges.
3+
type: added
4+
authors:
5+
- name: Jason Gerlowski
6+
links:
7+
- name: SOLR-13309
8+
url: https://issues.apache.org/jira/browse/SOLR-13309

0 commit comments

Comments
 (0)