quickwit-oss/tantivy
Ver no GitHubMissing search results with in memory index
Open
#1.824 aberto em 23 de jan. de 2023
good first issuehelp wanted
Métricas do repositório
- Stars
- (8.354 stars)
- Métricas de merge de PR
- (Mesclagem média 12d 14h) (20 fundiu PRs em 30d)
Description
I've been working on a small command line app to merge bibtex files and have been using tantivy to index paper titles. I noticed some strange behavior where if I (from python extension):
- Create an in memory index
- Call
writer.add_documentin a for loop - Call
writer.commit()outside the for loop The search results I'd expect to be exact matches (duplicate detection) are not showing up. I reran the same code several times and every so often I do get the correct results, which suggested to me that on commit, some index entries were getting lost. If I havewriter.commitinside the for loop, the issue goes away. Likewise, if I use a file-based index, the issue also goes away.
Reading the docs, it looks like even with an in memory index, calling writer.commit() after the for loop and not in it should work, is there something I'm missing or might this be a bug?
If it's not a known issue already and you cant reproduce it, once I finish with my cli I can share the relevant code.