Skip to content

Try out a tantivy's term dictionary format #12513

@Tony-X

Description

@Tony-X

Description

Hello!

I've been working on a benchmark for a while to compare the features and performance of Lucene and Tantivy, a rust search engine library which was heavily inspired by Lucene.

The benchmark uses the corpus and queries from luceneutil (the framework for Lucene nightly bench). Since not all query types are supported by Tantivy, currently it focuses on Term/Boolean/PhraseQuery. Tantivy in general showed performance advantages for now and I got motivated to understand why.

I documented the two engines' inverted index implementations per my understanding. Here is the wiki. Specifically, both engines use FST to aid the term lookup but the way they use them are quite different. In summary, Lucene uses FST to map term prefixes followed by scanning the on-disk blocks of terms. Tantivy uses FST to maps all the terms to their ordinals and use that ordinal/index to decode at most one full block.

The proposal here is to try Tantivy's term dictionary which I can see some advantages

  1. it can determine a term does not existing with only FST operations.
  2. decoding less terms in worst case (a term within a large gap between two prefixes)
  3. it is simpler? (might be subjective, but it took me days to digest Lucene90BlockTreeTermsWriter and I'm still not sure I got every bits correct...)

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions