Commit efca456
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
- changelog/unreleased
- solr
- core/src
- java/org/apache/solr
- schema/numericrange
- search
- numericrange
- test-files/solr/collection1/conf
- test/org/apache/solr
- schema/numericrange
- search/numericrange
- solr-ref-guide/modules
- indexing-guide/pages
- query-guide/pages
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments