Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPE when searching after deleting docs #159

Merged
merged 4 commits into from
Sep 18, 2020
Merged

Conversation

alexklibisz
Copy link
Owner

Based on #158

So far it seems that the solution is:

  1. Explicitly handle the possibility of null returned when calling leafReader.terms(field).
  2. Use leafReader.numDocs instead of indexReader.numDocs to determine the total number of possible docs.

Added a test for this scenario: index some docs, run a search, delete one doc, run a search, put the doc back, run a search. This passes locally.

@alexklibisz alexklibisz merged commit 55fac2a into master Sep 18, 2020
@alexklibisz alexklibisz deleted the delete-vector-npe branch September 18, 2020 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant