How to use Gnome Tracker? (sort/rank results)

I use Tracker a lot, but after my recent Fedora upgrade I have had to stop using it.

I have a folder per year, with a filename format within each year, so:

2001/receipts.ods
2002/receipts.ods
2003/receipts.ods

2023/receipts.ods
and so on.

In 2023 I only touch the 2023 version of the file. I might open older versions of the file occasionally.

How can I ask tracker to show me the most recent results for “receipts” or “receipts.ods” when I search?

The simplest way I can think of would be to use Nautilus, search for receipts in the UI and then sort using the “Modified” column to show the newest file first.

Something like

tracker3 sparql -b org.freedesktop.Tracker3.Miner.Files  -q 'SELECT ?f ?lastmod WHERE { ?f nfo:fileName ?name . ?f nfo:fileLastModified ?lastmod . FILTER(?name = "receipts.ods") } 
ORDER BY DESC(?lastmod)'

?

(which should give same result as @sthursfield answer :slight_smile: )

Aha - Can I make this the default?

I think the current results are unsorted, and I cannot influence the sort (they are not sorted by path or last modified at least). I wonder why the default was chosen.

In Nautilus they should default to being sorted by FTS match ranking, i.e. how closely the file matches the search terms. In the case of 5 files with the same name, I guess the order might be undefined. I wonder if it could be improved.

Looking at the innards of nautilus-search-engine-tracker.c it seems to only sort by rank currently - src/nautilus-search-engine-tracker.c · main · GNOME / Files · GitLab

I wonder if it could be improved.

Can I request this somehow? Either taking the path into account or the modified time (or frequency - is there that? if yes recent frequency would be better).

If its a change request in Nautilus you can look at the issue here - GNOME / Files · GitLab - and open one if you don’t see your issue there already.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.