apache / apache/lucene

Add spatial edge approximations: include/exclude/center [LUCENE-4900]

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

Description

The RecursivePrefixTree predicates incidentally buffer the query shape slightly to your specifications (distErr, distErrPct) as a byproduct of fitting it to a grid, thus making the search area slightly (or not so slightly) larger than the given shape. Because of the grid approximation, some amount of this is unavoidable. The result is that these predicates can match some false-positives that are slightly outside the query shape. The user might want instead to not match those false positives on the edge at all and is willing to accept the reverse inaccuracy – not matching false-negatives i.e. sort of reverse-buffering the shape edge. Or the user might instead want to substitute the center point of the a cell at the shape's edge to detect if it's a match or not – thus some false-positives will match and some false-negatives won't match but at a higher detail.

Based on the way these predicates are implemented, it'd be pretty easy to add support for these conditions. Arguably there is an index-time analog to this idea as well but that'd be harder.

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

Contributor guide

Open the contributing guide

Research direction

Start by locating the RecursivePrefixTree predicates and reading how their grid approximation handles query shapes. Define the include, exclude, and center edge behaviors from the issue, then add coverage for false-positive and false-negative boundary cases to verify the selected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
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.