apache / apache/lucene

Add DecimalRangePrefixTree [LUCENE-5746]

Open
#6,808 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major module:spatial type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

The abstract class NumberRangePrefixTree only has a DateRangePrefixTree concrete implementation. Obviously an integer/long based subclass would be great too, and wouldn't be as difficult as Dates except for its extra configurability.

I imagine a user being able to specify the smallest value and the largest value (or pre-fill both based on full ranges of Integer or Long or Float or Double). When Float or Double is used, it would internally use the int or long representation (e.g. Double.doubleToLongBits). It should have the option of working in fixed-point decimal, or floating-point. Fixed-point is advantageous assuming the ranges (indexed and/or query) are expected to use multiples of 10 (for example) because then you could configure the cells-per-level to be 10.

The existing abstract "NumberRangePrefixTree" should perhaps be renamed to "AbstractRangePrefixTree" thus freeing up its existing name for the feature called out on this issue.

---
Migrated from [LUCENE-5746](https://issues.apache.org/jira/browse/LUCENE-5746) by David Smiley (@dsmiley)

Contributor guide

Open the contributing guide

Research direction

Start by reading the abstract NumberRangePrefixTree and its DateRangePrefixTree implementation. The issue proposes a configurable DecimalRangePrefixTree supporting integer, floating-point, and fixed-point ranges, plus possibly renaming the abstract class. No files or tests are named; done requires an agreed design and a complete concrete implementation with coverage for the supported range configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.