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

[BUG] IDF change to 0 after writing the same text three times #4651

Open
freecw opened this issue May 19, 2024 · 6 comments
Open

[BUG] IDF change to 0 after writing the same text three times #4651

freecw opened this issue May 19, 2024 · 6 comments
Assignees
Labels

Comments

@freecw
Copy link

freecw commented May 19, 2024

image

@meiravgri
Copy link
Collaborator

@freecw Hi.
Indeed looks like a bug! Good catch!
Thanks.

@freecw
Copy link
Author

freecw commented May 21, 2024

@meiravgri it seems the "IDF" will change to 0 after we deleting another key

image

@meiravgri
Copy link
Collaborator

I've found the root cause for this bug and opened an internal ticket to our team.
We'll address this asap. Thanks for reporting.

@freecw
Copy link
Author

freecw commented May 21, 2024

@meiravgri Thanks, could you please share the root cause? And any expected time for addressing this?

@meiravgri
Copy link
Collaborator

sure
IDF score depends on sp->docs.size and idx->numDocs like so:

logb(1.0F + sp->docs.size / (idx->numDocs ? idx->numDocs : (double)1));

Since idx->numDocs reflects the number of valid docs + updated docs that weren’t yet cleaned by the gc, AND the default gc threshold is 100, the score is calculated based on wrong index statistics.

As a temporary workaround you can decrease the the gc threshold:
FT.CONFIG set FORK_GC_CLEAN_THRESHOLD 0

@freecw
Copy link
Author

freecw commented May 21, 2024

Thanks @meiravgri . Any update on addressing this issue is highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants