-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
A simple unit-test for zim::Search
doesn't work
#471
Comments
The main entry is a generated entry which is a redirection to the real main page. If you follow the redirection and do a query using the real entry title it should work. (If not we have a bug). |
Trying to resolve the redirect (
When using
Regenerating |
On old zim file, the mainEntry is directly the "real main entry". On new zim file is a redirection to it.
This is a bug. |
@veloman-yunkan @mgautierfr what next? This is preety urgent that this is fixed and that the CI works again, so we can merged the PRs whoch are pilling up since december. |
It turns out that by default Search::Search(const std::vector<const File*> zimfiles) :
internal(new InternalData),
zimfiles(zimfiles),
prefixes(""), query(""),
latitude(0), longitude(0), distance(0),
range_start(0), range_end(0), // !!!!!!!!!!!!!!!!!!!
... Search::Search(const File* zimfile) :
internal(new InternalData),
prefixes(""), query(""),
latitude(0), longitude(0), distance(0),
range_start(0), range_end(0), // !!!!!!!!!!!!!!!!!!!
... Then, when the query is executed, 0 is passed for the
Explicitly providing in the unit test a query range via |
@veloman-yunkan Thank you very much for this analysis. To me, and if I understand properly, the following two things are "buggy":
IMO, we need a default range set, but not sure if this should be the estimation (does this max range estimation is expensive to run?) or a fix value. The workflow needs obviously to be fixed to be more robust and stop doing unexpected things "in the back" of the user. |
Might be related to #463 as well |
Indeed, the Lines 191 to 204 in b3e64fe
This has been removed with the new api and now we face some inconsistency with the Search class.
We probably have to rethink a bit the api (and the internal structure) |
While working on #449 I encountered problems with search. It turns out that at least part of those problems are not related to my changes since they are present in the
master
branch too. The following simple unit test fails:Originally, I used the recently created ZIM archive
test/data/small.zim
in the unit test, but to eliminate the possibility that that ZIM file has problems due to recent changes in libzim I reproduced the same failure on the old ZIM filewikipedia_en_climate_change_nopic_2020-01.zim
.The text was updated successfully, but these errors were encountered: