kiwix-android
kiwix-android copied to clipboard
Should be able to easily open article with exact name
Describe the bug
It is very hard to search for things like the word "a" in Kiwix.
While this most visibly affects the word "a," it affects most short words in Wiktionary.
Kiwix is using the query as a prefix but not making sure the exact match is the first result. This was unusable on 3.2 when the search results were limited, but even though it is possible to open the word "a" now on 3.3, I need to scroll down a lot and find a needle in a haystack.
On Kiwix Linux I can press enter to go to an article with the exact name, but on Android pressing the search (enter) button in GBoard only dismisses it.
Expected behavior
- ~~The exact match to always be the first search result.~~
- ~~Enter button on keyboard open the article with the exact name, just like on Kiwix Linux~~
- Some way to easily open an article using its exact name
Steps to reproduce the behavior:
- Open
wiktionary_en_all_maxi_2020-01.zim
- Enter "a" in search
- Spend a lot of time trying to find the definition for "a"
Screenshots
Hard to find the definition for "a" in Kiwix Android (no sorting, and broken enter key):
Easy to find the definition for "a" on official Wiktionary website (sorted, and working enter key):
Environment
- Version of Kiwix Android : 3.3.0
- Device : OnePlus 7 Pro
- OS version : OxygenOS Beta 11
I would like to work on this
Here is a video of my preliminary implementation of the exact article opening when the search button on GBoard is pressed:
Enter button on keyboard open the article with the exact name, just like on Kiwix Linux
I don't think this is a good idea, enter on a search field is meant to be submit
aka fetch me results for this, right now we ignore this because we already search for data on each input.
This is how it works on the official Wikipedia website. Most people who use Wikipedia, whether they also use Kiwix or not, would expect this behavior. The enter button can mean "submit," but it can also mean "I'm feeling lucky."
It actually doesn't matter how the underlying problem is solved. I don't care that much (only a little bit about consistency between Android/Linux) about how I am able to open the article with the exact name. I want to be able to give Kiwix an exact article title, and be able to tell Kiwix to open it without too many taps.
We are not Wikipedia though, the app is most analogous to a browser and when I tap submit on a search in chrome it searches for it, though I guess if you address a webpage specifically it also goes to it. There could also be the issue where searching takes a long time to load (haven't witnessed it but there have been reports) where an "I'm feeling lucky" would be an ambiguous input.
If the search results are reordered so an exact match is at the top then it is 1 click away after a user has completed desired input, I think that will be sufficient. Thanks for adding this functionality
@macgills @danielzgtg I would just like to have more time to think about that more in details. To a certain extend, what @danielzgtg asks for is how kiwix-serve and kiwix-desktop works.
what @danielzgtg asks for is how kiwix-serve and kiwix-desktop works
This is exactly what I was trying to say.
Initially, it might have been confusing how I mixed up the titles for the issue/PR, but I fixed them later. I had come up with the ideas for both at the same time.
Going from Desktop to Android, I miss the ability to easily open an article by its exact name. This issue+PR is just requesting the feature to be ported.
Well I am very much in favour of the current PR to move the exact match to the top, we can await kelson's decision before going any further
in favour of the current PR to move the exact match to the top
Meanwhile, I have become only weakly in favor of it. I took a lot of the stuff I wanted out of that PR, such as sorting when kelson mentioned how that kind of logic belonged in libkiwix, as well as the enter button support after it was separately discussed from the rest of the PR.
Even the code that moves the exact match to the top might be moved to libkiwix. That would leave only the tests (which are important) in the PR. As an aside, while we are moving things to libkiwix, we could also move the distinct
search result code out of the Android part.
kelson's decision before going any further
Indeed. Note that I actually went backwards (i.e. removed stuff) with regards to the PR and the rest is just responding to reviews.
I removed the word "Fixes" from the PR as its now only one of potentially three parts for this issue. The other two parts still remain unwritten, awaiting kelson's decision as to where, whether, and how to implement the sorting and enter button features
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
@kelson42 I am testing this ticket with #3217.
@danielzgtg asks for is how kiwix-serve and kiwix-desktop works.
@mgautierfr confirms that kiwix-server
using the SuggestionSearch
all the time and we also now use the SuggestionSearch
in Android code. I have tested it, and the results we are searching for are now showing the same results that we have searched for, which is the aim of this ticket.
See https://github.com/kiwix/libkiwix/issues/748
@MohitMaliFtechiz I believe the essence of this ticket is a duplicate of https://github.com/kiwix/kiwix-android/issues/2896 and has been implemented actually? What do you think?
@kelson42 I agree with you.
The exact match to always be the first search result. Enter button on keyboard open the article with the exact name, just like on Kiwix Linux Some way to easily open an article using its exact name
We have a ticket for the first point in libzim https://github.com/openzim/libzim/issues/766. For the other two points, we have implemented in https://github.com/kiwix/kiwix-android/issues/2896 (if the article is found with the exact name then kiwix opens that article). Also we have improved our press Enter to skip the search
functionality in https://github.com/kiwix/kiwix-android/pull/3722, which ensures that the search result is exactly what we have searched. Which is the aim of this ticket.
Edited: We can close this issue once https://github.com/kiwix/kiwix-android/pull/3722 merged.