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

kiwix-search should report about missing ft index #138

Closed
kelson42 opened this issue Dec 20, 2017 · 7 comments
Closed

kiwix-search should report about missing ft index #138

kelson42 opened this issue Dec 20, 2017 · 7 comments

Comments

@kelson42
Copy link
Contributor

If a ZIM file is missing the ft index then kiwix-search should:

  • return 1 (or any not null error code)
  • print an error on STDERR reporting the missing of the index (and therefore the impossibility to run the search properly).

This should work with and without the --suggestion option. In case of --suggestion, as we have a fallback solution (based on native ZIM title list), the returned value should be 0, the error message should be printed on STDERR as a warning.

Requirement comes from #130 discussion

@julianharty
Copy link
Contributor

Yay, thank you.

@arjun-369
Copy link
Contributor

I'd like to resolve this issue. The code can be traced from kiwix-search.cpp to reader.cpp, that provides a method to check if a fulltext index exists within a .zim file.
The ZIM files from #130 aren't available.
Can you provide me with some ZIM files which can be used to test the code.

@kelson42
Copy link
Contributor Author

kelson42 commented Apr 6, 2021

I don't think we have one but You can build one pretty easily with mwoffliner

@arjun-369
Copy link
Contributor

Screenshot from 2021-04-07 15-05-47
In the above image, the ZIM file "wikipedia_en_sociology_nopic_2021-03.zim" contains a fulltext index while the ZIM file "wikiquote_en_all_2021-04.zim" does not contain a fulltext index.

@kelson42
Copy link
Contributor Author

kelson42 commented Apr 7, 2021

@arjun-369 Seems you are on the right path, check that all the requirements of the ticket are fullfilled and open a PR please

@mgautierfr
Copy link
Member

This should work with and without the --suggestion option. In case of --suggestion, as we have a fallback solution (based on native ZIM title list), the returned value should be 0, the error message should be printed on STDERR as a warning.

In kiwix-search tool, we always the kiwix-lib's Searcher to do the search (suggestion or not).
The Searcher always use the xapian database, the fallback is made by the Reader.

I've tried to change this #136 but you disagree about that (we probably had a discussion elsewhere to agree to drop it).

@kelson42 kelson42 moved this from In progress to Review in Improved search (ft/suggestions) Apr 8, 2021
@mgautierfr
Copy link
Member

I've missed read the @kelson42 comment. It was about the return code, not making the suggestion using the fallback.
So I agree.

@kelson42 kelson42 moved this from Review to Done in Improved search (ft/suggestions) Apr 28, 2021
@kelson42 kelson42 closed this as completed May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants