Make MemoryIndex immutable [LUCENE-7394]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
The MemoryIndex itself should just be a builder that constructs an IndexReader instance. The whole notion of freezing a memory index should be removed.
While we change this we should also clean this class up. There are many methods to add a field, we should just have a single method that accepts a `IndexableField`.
The `keywordTokenStream(...)` method is unused and untested and should be removed and it doesn't belong with the memory index.
The `setSimilarity(...)`, `createSearcher(...)` and `search(...)` methods should be removed, because the MemoryIndex should just be responsible for creating an IndexReader instance.
---
Migrated from [LUCENE-7394](https://issues.apache.org/jira/browse/LUCENE-7394) by Martijn van Groningen (@martijnvg), updated Oct 11 2018
Contributor guide
Research direction
Locate MemoryIndex and its existing callers and tests; start by tracing how it currently freezes and creates an IndexReader. Check the uses of the field-addition methods, keywordTokenStream, setSimilarity, createSearcher, and search. Done means MemoryIndex only builds an IndexReader, with the obsolete freezing and search APIs removed.
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