OK, there are probably more than two other gnome users here … but I do like hyperbole.
Many years ago, when gnome development actually focused on adding useful features instead of removing them, nautilus added a search filter. So you can search for everything called “foo” and limit the results to all “foo” that is video. That works great so long as foo is not foo.mkv! A genuinely stupid oversight that the gnome team will NEVER fix! And the fix is TRIVIAL!
--- nautilus-45.2.1.orig/src/nautilus-mime-actions.c 2023-12-06 04:03:31.000000000 -0600
+++ nautilus-45.2.1/src/nautilus-mime-actions.c 2024-06-29 07:55:53.466029698 -0500
@@ -152,6 +152,7 @@
"audio/x-mpeg",
"audio/x-ms-asx",
"audio/x-pn-realaudio",
+ "audio/x-matroska",
NULL}},
{ N_("PDF / PostScript"),
{ "application/pdf",
@@ -217,6 +218,7 @@
"video/x-msvideo",
"video/x-nsv",
"video/x-real-video",
+ "video/x-matroska",
NULL}}
};
This same patch can be applied to any version of nautilus going back many many years.
Also going back to a time when gnome added useful features instead of removing them, nautilus integrated tracker results into it’s search engine. Hottest thing since sliced bread! OK, I like cliché as well as hyperbole; I wish I could “zypper dup” on my brain. I can search my music by “soundtrack” and limit my results to songs that are from films, even though the word “soundtrack” is NOT in the filename. I can search my videos by “thiller” and get a list of suspenseful movies even though the word “thriller” is not in any of the file names.
Of coarse, users of windoZe and osX enjoy similar functionality and have for years.
When gnome migrated from tracker2 to tracker3, this feature got broken. My best guess is that it was originally an oversight, but with gnome it is really hard to tell. (I have reported bugs only to learn that the “bug” was actually a “design choice” … I don’t waste my time reporting bugs to gnome anymore … eventually I will go back to cinnamon even though I prefer gnome …) Up until the latest releases of nautilus, the fix was extremely simple:
--- nautilus-42.2-orig/src/nautilus-search-engine-tracker.c 2022-09-02 22:46:05.740683749 -0500
+++ nautilus-42.2/src/nautilus-search-engine-tracker.c 2022-09-02 22:51:19.515838433 -0500
@@ -364,7 +364,7 @@
if (tracker->fts_enabled)
{
- g_string_append (sparql, "FROM tracker:Documents ");
+ g_string_append (sparql, "FROM tracker:Documents FROM tracker:Pictures FROM tracker:Audio FROM tracker:Video");
}
g_string_append (sparql,
Not exactly the same for nautilus 44, but the same idea works … add the missing “FROM” strings.
With nautilus 45, it gets slightly more complicated:
--- nautilus-45.2.1.orig/src/nautilus-search-engine-tracker.c 2023-12-06 04:03:31.000000000 -0600
+++ nautilus-45.2.1/src/nautilus-search-engine-tracker.c 2024-06-29 15:18:24.914066641 -0500
@@ -369,17 +369,55 @@
{
g_string_append (sparql,
" { "
- " SELECT ?file " VARIABLES " {"
- " GRAPH tracker:Documents {"
- " ?file a nfo:FileDataObject ."
- " ?content nie:isStoredAs ?file ."
- " ?content fts:match ~match ."
- " BIND(fts:rank(?content) AS ?rank) ."
- " BIND(fts:snippet(?content,"
+ " SELECT ?file " VARIABLES " WHERE {"
+ " {"
+ " GRAPH tracker:Documents {"
+ " ?file a nfo:FileDataObject ."
+ " ?content nie:isStoredAs ?file ."
+ " ?content fts:match ~match ."
+ " BIND(fts:rank(?content) AS ?rank) ."
+ " BIND(fts:snippet(?content,"
" '_NAUTILUS_SNIPPET_DELIM_START_',"
" '_NAUTILUS_SNIPPET_DELIM_END_',"
" '…',"
" 20) AS ?snippet)"
+ " }"
+ " } UNION {"
+ " GRAPH tracker:Pictures {"
+ " ?file a nfo:FileDataObject ."
+ " ?content nie:isStoredAs ?file ."
+ " ?content fts:match ~match ."
+ " BIND(fts:rank(?content) AS ?rank) ."
+ " BIND(fts:snippet(?content,"
+ " '_NAUTILUS_SNIPPET_DELIM_START_',"
+ " '_NAUTILUS_SNIPPET_DELIM_END_',"
+ " '…',"
+ " 20) AS ?snippet)"
+ " }"
+ " } UNION {"
+ " GRAPH tracker:Audio {"
+ " ?file a nfo:FileDataObject ."
+ " ?content nie:isStoredAs ?file ."
+ " ?content fts:match ~match ."
+ " BIND(fts:rank(?content) AS ?rank) ."
+ " BIND(fts:snippet(?content,"
+ " '_NAUTILUS_SNIPPET_DELIM_START_',"
+ " '_NAUTILUS_SNIPPET_DELIM_END_',"
+ " '…',"
+ " 20) AS ?snippet)"
+ " }"
+ " } UNION {"
+ " GRAPH tracker:Video {"
+ " ?file a nfo:FileDataObject ."
+ " ?content nie:isStoredAs ?file ."
+ " ?content fts:match ~match ."
+ " BIND(fts:rank(?content) AS ?rank) ."
+ " BIND(fts:snippet(?content,"
+ " '_NAUTILUS_SNIPPET_DELIM_START_',"
+ " '_NAUTILUS_SNIPPET_DELIM_END_',"
+ " '…',"
+ " 20) AS ?snippet)"
+ " }"
" }"
" GRAPH tracker:FileSystem {"
TRIPLE_PATTERN
While I think there is probably a more elegant way to rewrite the search, this quick and dirty patch works and the performance is still good.
If I ever get sufficiently motivated, I am going to fork nautilus and start re-adding all the useful features that have been removed.
I will call it KRAKEN!