-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Online library filter/search API calls are not optimal #957
Comments
@mgautierfr @veloman-yunkan @juuz0 Does that make sense? Is the libkiwix ready for that? |
One interesting problem here is to handle the sorting of books. |
Yes, we have multiple tickets regarding sorting of results. But we could handle this with kiwix/libkiwix#702. Please put the requirements you have in a comment so you can secure Kiwix-Desktop features can continue to work. |
does the cache here have to be implemented in libkiwix? |
@mgautierfr We urgently need your feedback here |
I am somehow against that. By definition a free text filtering will only reduce the number of books and so we could do filtering locally. And so avoid data transfer between the client and the server. That why we implement it this way. BUUUTTT if we go in the direction of using partial entries and pagination, we cannot do the filtering locally as we don't have the list of all books (and their details). So ... yes, by implementation need, all search/filtering/sorting have to be done on the server.
Agree
Not so easy. And maybe not so useful.
That's the purpose of partial_entries (to get list of books only) and entry (to get information about a specific book) As suggested somewhere (I cannot find where), I think we should introduce a "RemoteLibrary" in libkiwix.
However, the RemoteLibrary would do request to the server for each methods (we almost already have a specific endpoint for each method) Request and caching strategy: We will use When user call About Illustration: This lead to download management: The problem here is that don't want the download to freeze the ui.
auto tuple = library.getBooksIds();
auto bookIds = tuple.1(download(tuple.0));
do_stuff_with_bookids(bookIds); A event driven application would use: auto tuple = library.getBooksIds();
auto request = Request(tuple.0);
request.on_completion([](response) {
auto bookIds = tuple.1(response.content);
do_stuff_with_bookids(bookIds);
});
request.do();
do_other_things_without_waiting_request_to_finish();
I would go with the easy solution and if not enough, move to the difficult solution. I have played a bit with the api:
(All done without filter) |
@mgautierfr It seems we agree on the first part and I agree also on the second part of your comment but this is something I would like to handle separatly (but maybe this is a prerequisite to this issue). Therefore I have copied it to this dedicated issue at kiwix/libkiwix#1171 |
For the moment, a new request of type "https://library.kiwix.org:443/catalog/search?lang=amh&count=-1&tag=_category:gutenberg¬ag=_sw:yes" is done each time a filter is changed in the sidebar. Then everything (book details, no pagination) is downloaded from https://library.kiwix.org. The "search" (currently library top bar) is then applied a posteriori on the local result list to have a match.
I'm not satified because that generates a lot of data transfered (slow and expensive) between local computer and library.kiwix.org.
I woud like to propose:
The text was updated successfully, but these errors were encountered: