Device OS and version: Cyanogen OS 13.1.2 (Android 6.0.1)
Device model/manufacturer: Oneplus One (aka A0001 aka Bacon)
F-Droid version (in the about screen): 0.100.1
Is it possible to add the ability to custom sort apps in a particular category or from a search result? When I am searching or browsing for apps, I am more likely to be interested to look at apps that have been updated recently (as in being actively developed), as opposed to the default sort-by-name. This can be useful because there are apps that have not been updated in a long time/abandoned etc and I would much rather be using something that is actively developed.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
As part of the UX Overhaul, we're currently thinking #709 (closed) of making the search also include the category. So if you're in a category screen and click search, the name of the category will automatically be included in the search box. For that to work, we also have to include the category in the text that the search function looks thru. @pserwylo I think we don't have an issue for this yet.
username-removed-24982Changed title: Option to custom sort search result → include category in the keyword index for searching
Changed title: Option to custom sort search result → include category in the keyword index for searching
@eighthave
Ah, thanks for the link. That is an interesting discussion. It would indeed be nice if the ability to sort-by-last-updated can also be implemented as a part of the new design overhaul.
So it turns out that the database layer already supports querying based on category (of course, in order to show a list of apps in a given query), but it is implemented in a really terribly amazing way. This is because the categories string is stored as a single text field in the database.
This results in the following horror of a query:
SELECT ... FROM ... WHERE ... AND (categories = 'keyword' -- The only category the app is inOR categories LIKE '%keyword' -- The last category in the listOR categories LIKE 'keyword%' -- The first category in the listOR categories LIKE '%, keyword,%' -- In the middle somewhere
This is slow because OR statements are terrible for indexes. Instead of each additional expression further limiting the results, each statement in an OR expands the list of results. This makes it harder to optimize such queries. In addition, if the optimizer decided that categories would be a nice thing to search on first, then it wouldn't be able to use an index on the categories field due to us using wildcards. Also, it doesn't allow for categories with commas in their name. Finally, it looks ugly and is confusing.
This really needs to be in a separate table, and then there will be a join table between apps and categories:
fdroid_appMetadata
id
name
summary
...
fdroid_category
id
name
fdroid_categoryAppMetadataJoin
categoryId
metadataId
repoId (Which repo dictated that this app should be in this category?)
Resulting in the following query:
SELECT ... FROMappJOIN appCatJoin ON (app.id = appCatJoin.appId)JOIN cat ON (appCatJoin.catId = cat.id) WHERE ... AND cat.name = 'keyword'
This will be a requirement for this issue (adding the cateogry to the list of things to search by keyword).
username-removed-25042Changed title: include category in the keyword index for searching → Optionally sort search results by recently updated rather than just alphabetically
Changed title: include category in the keyword index for searching → Optionally sort search results by recently updated rather than just alphabetically
So I think I misread this originally. I've changed the title to reflect my new understanding of this issue. The next stable release will include searching based on categories, but not sorting. The searching is such that if you enter the name of a category in the search input (e.g. "games") it should include all results from that category. This is a little broken when you think of categories with spaces in them, but that will be addressed better in #795 with the new UI stuff we are working on. I can envision how e could include sorting in that new UI too, which would address this current issue.
@pserwylo
Sorry its been a while, I had other things going on and this got buried under those.
Anyway, yes Peter, you are right. Although I like the idea of serching categories (as you said, if I search 'games', it should list me everything that falls in that category), but that was NOT what I had meant.
You go it right in your reply, I want to sort apps so that, instead of listing alphabetically, list them in the order of most recently updated to least recently updated. (So if I search something like 'message' and the results include 'A' and 'B', if 'B' was updated more recently, I want the option to show B first rather than A. The default sort alphabetically always shows A first and then B. But this does not always make sense, especially if A was not updates, say, for over 2 years.)
Alternatively, you can get the same sort of results with a** filter option**, that will add this 'filter' to the search results to display apps that meet certain criteria. In this case, the criteria can be something like 'APPS UPDATED IN THE LAST 6(some number) MONTHS/WEEKS/DAYS' or something. Then we no longer need to sort-by-recently-updated. Because all results will be relevant.
This to me appears easier than sorting, though I have not given it any thought. What is your opinion?
Is it correct to summarize or reformulate the request for sorting of lists of apps in F-Droid client to:
in tab AVAILABLE selection What's New and selection Recently Updated: always sort on date added descending, secondary sort is name of app alphabetically ascending
in tab AVAILABLE all other selections:
(default) name of app alphabetically ascending
date added descending, secondary sort is name of app alphabetically ascending
license alphabetically ascending, secondary sort is name of app alphabetically ascending
in tab INSTALLED: identical to sort for other selections
in tab UPDATES: identical to sort for selection What's New
The main menu with Swap apps. Repositories, etc. should offer an item called Sort with the one-of-n choices:
alphabetically (default)
date added
license
This setting will only affect AVAILABLE / other selections and INSTALLED
@Pander Yes, that is essentially it. Also, just to make it clear, when a search is performed in any of the category, the sort option should remain in effect. So when a search is performed and results in a list, the list must be sorted as specified.