Spatial CellTokenStream re-use [LUCENE-5776]
- 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
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