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: full text search index broken after optimize_indices() #3145

Merged
merged 8 commits into from
Nov 22, 2024

Conversation

BubbleCal
Copy link
Contributor

this can be reproduced by optimizing FTS without any new data.
the existing tokens could be reordered then the offsets broken, leads to the index would return random results.
existing tests only verify whether the new data can be queried, so we didn't find this bug.
added a test to query existing data

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@github-actions github-actions bot added the bug Something isn't working label Nov 20, 2024
Copy link

ACTION NEEDED
Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@BubbleCal BubbleCal changed the title fix: FTS index broken after optimize_indices() fix: full text search index broken after optimize_indices() Nov 20, 2024
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@BubbleCal BubbleCal added the rust Rust related tasks label Nov 20, 2024
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@BubbleCal BubbleCal removed the rust Rust related tasks label Nov 20, 2024
@BubbleCal BubbleCal marked this pull request as ready for review November 20, 2024 11:25
@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 95.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 77.98%. Comparing base (71f323a) to head (7140241).

Files with missing lines Patch % Lines
rust/lance-index/src/scalar/inverted/index.rs 77.77% 0 Missing and 2 partials ⚠️
rust/lance-index/src/scalar/inverted/builder.rs 87.50% 0 Missing and 1 partial ⚠️
rust/lance/src/index.rs 98.41% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3145      +/-   ##
==========================================
+ Coverage   77.93%   77.98%   +0.05%     
==========================================
  Files         242      242              
  Lines       81736    81798      +62     
  Branches    81736    81798      +62     
==========================================
+ Hits        63698    63794      +96     
+ Misses      14849    14812      -37     
- Partials     3189     3192       +3     
Flag Coverage Δ
unittests 77.98% <95.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Comment on lines +1338 to +1344
dataset
.optimize_indices(&OptimizeOptions {
num_indices_to_merge: 0,
index_names: None,
})
.await
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's no new data, does optimize indices do anything? Will it in the future? Should you append some new data before running this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's possible, like merging existing indices. but i think it should do nothing for scalar index & FTS, because they always have only 1 delta index. added adding new data here and make the tests cover more cases

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@BubbleCal BubbleCal requested a review from wjones127 November 21, 2024 02:45
@BubbleCal BubbleCal merged commit bf2ce1f into lancedb:main Nov 22, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants