apache / apache/lucene

Remove PrefixTreeStrategy.makeDistanceValueSource support [LUCENE-9689]

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

Description

PrefixTreeStrategy.makeDistanceValueSource reads all the full length terms and puts them into memory.  And it does this rather crudely; it's not efficient, unlike much other Lucene code.  Furthermore, it can be mis-used when non-point data is put into the RPT, leading to undefined results.  We could add "isPointsOnly" to make it safe, but I think support for this ought to be removed; instead users can use LatLonDocValuesField.newDistanceSort for geospatial data (surface of earth), or PointVectorStrategy for general 2D.

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

Contributor guide

Open the contributing guide

Research direction

Start at PrefixTreeStrategy.makeDistanceValueSource and inspect its callers and related geospatial strategy APIs. Review the issue’s suggested LatLonDocValuesField.newDistanceSort and PointVectorStrategy alternatives. Done means the unsupported method is removed safely, with affected references and relevant tests or documentation updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.