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

For xapian to check 10 documents when asking for empty mset. #625

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

mgautierfr
Copy link
Collaborator

Forcing xapian to check 1 documents is not enough and it may still leads to wrong results.

This is difficult to know which is the good number to put here, between a small number to avoid too many checks and a big number to force a accurate result.
10 seems to work for now, at least for small results set as used in tests.

This fix the unit test bug in python-libzim https://github.com/openzim/python-libzim/runs/3672830814

I ask for a favor here and do not add a specific unit test in libzim.
It would need to add a new content in openzim/zim_testing_suite and the change is pretty well contained, I don't see how it could break things.

Forcing xapian to check 1 documents is not enough and it may still leads
to wrong results.

This is difficult to know which is the good number to put here,
between a small number to avoid too many checks and a big number to force
a accurate result.
10 seems to work for now, at least for small results set as used in tests.
@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #625 (6f6d828) into master (0374889) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #625   +/-   ##
=======================================
  Coverage   84.55%   84.55%           
=======================================
  Files          97       97           
  Lines        4183     4183           
  Branches     1883     1858   -25     
=======================================
  Hits         3537     3537           
  Misses        645      645           
  Partials        1        1           
Impacted Files Coverage Δ
src/search.cpp 87.76% <100.00%> (ø)
src/suggestion.cpp 94.35% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0374889...6f6d828. Read the comment docs.

Copy link
Collaborator

@maneeshpm maneeshpm left a comment

Choose a reason for hiding this comment

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

Selecting a good number is indeed difficult. But I trust your testing here and we can expedite the need for a unit test.
But yes, since most of our implementation in libkiwix deals with getting results in the range 10(for suggestions) to 25(for search), checking at least 10 results seems reasonable.

@mgautierfr mgautierfr merged commit 8f25681 into master Sep 22, 2021
@mgautierfr mgautierfr deleted the min_result_estimatedmatches branch September 22, 2021 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants