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

feat: upgrade tantivy to 0.22 #242

Merged
merged 10 commits into from
May 3, 2024

Conversation

cjrh
Copy link
Collaborator

@cjrh cjrh commented Apr 21, 2024

NOTE: This is intentionally still a rough WIP (Sunday night hack time!). I want to get feedback on the macro changes first before putting in more work.

Two changes in tantivy 0.21 -> 0.22 that made the upgrade a little tricky:

  • tantivy::schema::document::Document is now a trait
  • tantivy::schema::document::Value is now a trait

We use these a fair bit, especially Value. However, I did some research and experimentation and it seems to me that we can use TantivyDocument (implements the now-trait Document) and OwnedValue (implements the now-trait Value).

The tests are passing. Is this the correct way to go?

If this is the right way to go, I'll proceed to clean up the messy bits in the next couple days and get it merged.

@cjrh cjrh added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code feature-parity Feature parity with upstream tantivy labels Apr 21, 2024
@cjrh cjrh self-assigned this Apr 22, 2024
@adamreichold
Copy link
Collaborator

The tests are passing. Is this the correct way to go?

Using TantivyDocument and OnwedValue is definitely the way to go if everything should continue to work as it does.

Making use of the new flexibility offered by the Document and Value is usually a follow-up in Rust code bases and I do not think it makes in the Python wrapper because need to handle generic documents without additional knowledge of their structure. It could be that we someday have a special document wrapper that directly uses Python compatible types, i.e. implement Document for our local Document struct.

@cjrh cjrh force-pushed the feat-update-tantivy-0-22 branch from 167e32c to da41a7e Compare April 25, 2024 21:41
@cjrh cjrh merged commit 983364b into quickwit-oss:master May 3, 2024
10 checks passed
@cjrh cjrh deleted the feat-update-tantivy-0-22 branch August 31, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file feature-parity Feature parity with upstream tantivy rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants