Skip to content

Fallback to binary search in suggestions search not working anymore? #981

@benoit74

Description

@benoit74

We have tests in python-scraperlib around the suggestions and full-text searches.

One of them is now failing with python-libzim 3.7.0 (linked to libzim 9.3.0):

https://github.com/openzim/python-scraperlib/blob/fef63f81fdb9dd6d2a5e17d9c8785e3fd22665e9/tests/zim/test_indexing.py#L114-L144

Test is failing on this line:

    assert "welcome" in list(reader.get_suggestions("brain"))

Same test with python-libzim 3.6.0 (linked to libzim 9.2.3-2) is OK.

This test specifically target the behavior of the libzim when there is no front article, and hence supposedly no Xapian suggestions index.

According to the comment in the test and linked issue, in such a case the libzim is supposed to fall back to binary search on titles in such a case, but it doesn't work as expected anymore.

I strongly suspect the issue is in libzim 9.3.0, since python-libzim is just a wrapper when it comes to suggestions. There is few lines of codes in python-scraperlib to automatically set the end value when fetching results, but I tried to bypass this code by setting an end value myself and it does not help.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions