apache / apache/lucene

Spatial CellTokenStream re-use [LUCENE-5776]

Open
#6,838 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

It would be nice if CellTokenStreams were re-used, which are kinda heavy. This is possible without changing the API thanks to #6696. PrefixTreeStrategy.createFields() should return Field subclasses that override `TokenStream tokenStream(Analyzer analyzer, TokenStream reuse)` that in turn examine re-use to ensure it's a CellTokenStream, and then re-use it if possible or create anew.

Completing the re-use, it would be good if TreeCellIterator could be re-used, which might include the getWorldCell value.

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

Contributor guide

Open the contributing guide

Research direction

Start by tracing PrefixTreeStrategy.createFields() and the Field subclasses it returns, then inspect TokenStream tokenStream(Analyzer analyzer, TokenStream reuse) and CellTokenStream. Next, examine TreeCellIterator, including getWorldCell; done means compatible CellTokenStream and TreeCellIterator instances are reused without changing the API.

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.