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

Convert search activity to use URLs not titles #765

Closed
mhutti1 opened this issue Jun 18, 2018 · 12 comments · Fixed by #1537
Closed

Convert search activity to use URLs not titles #765

mhutti1 opened this issue Jun 18, 2018 · 12 comments · Fixed by #1537
Assignees
Milestone

Comments

@mhutti1
Copy link
Contributor

mhutti1 commented Jun 18, 2018

Code Improvement

Convert the search activity to use URLs rather than titles to reference articles internally and in the saved recent search database.

@mhutti1
Copy link
Contributor Author

mhutti1 commented Jun 28, 2018

This will require a database migration.

@Aditya-Sood
Copy link
Contributor

@mhutti1 the recentSearch database has a zimID field which seems to contain dash separated hexadecimals. What does it refer to exactly? I couldn't figure that out

@mhutti1
Copy link
Contributor Author

mhutti1 commented Mar 19, 2019

zimID is the id of the ZIM file every file should have a unique id. zimName doesn't change between content upgrades.

@Aditya-Sood
Copy link
Contributor

So this issue is aimed at replacing the zim ID everywhere with the corresponding URL and then subsequently using that URL for identifying the zim file?

@mhutti1
Copy link
Contributor Author

mhutti1 commented Mar 23, 2019

No its about the search activity not the content management activity.

@stale
Copy link

stale bot commented Jun 26, 2019

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.

@stale
Copy link

stale bot commented Aug 29, 2019

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.

@stale stale bot added the stale label Aug 29, 2019
@Aditya-Sood
Copy link
Contributor

Discussion about integrating a possible fix for this issue is taking place at kiwix-build/#354

@stale stale bot removed the stale label Sep 1, 2019
@macgills
Copy link
Contributor

macgills commented Sep 6, 2019

@Aditya-Sood what is the state of this? Why does it need a kiwix-lib update?

 ZimContentProvider.searchSuggestions(query, 200);
            String suggestion;
            String suggestionUrl;
            List<String> alreadyAdded = new ArrayList<>();
            while ((suggestion = ZimContentProvider.getNextSuggestion()) != null) {
              suggestionUrl = ZimContentProvider.getPageUrlFromTitle(suggestion);

it seems like we already get all the data we need? Title/url of the suggestion and ZimContentProvider has the ZimId.
I feel like I am missing something here. This screen is also a prime candidate for unidirectional data flow and updating with a recyclerview

@Aditya-Sood
Copy link
Contributor

There's an implementation of getNextSuggestion() in kiwix-lib which, along with a title, also returns the corresponding url (link to function). Using this implementation will help avoid the cost of an additional call at:

suggestionUrl = ZimContentProvider.getPageUrlFromTitle(suggestion);

That is what I am looking at until now. But I need to go through SearchActivity again because I think @mhutti1 is hinting at a more comprehensive overhaul of the activity.

@macgills
Copy link
Contributor

Given the late hour of the milestone and seeing as how this is a code improvement that won't affect UX I would say this can be moved on to 3.1 or collected in a 3.0.X patch.

@Aditya-Sood
Copy link
Contributor

Before merging, the kiwix-android PR #1537 needs to be updated to use the kiwix-lib version number with the kiwix-lib PR #289 merged to master

Aditya-Sood added a commit that referenced this issue Nov 7, 2019
macgills added a commit that referenced this issue Nov 29, 2019
Enhancement: Fixes #765 & uses updated kiwix-lib method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants