In previous versions of nautilus, FTS could be fully enabled by simply adding the appropriate “FROM” to the search string in src/nautilus-search-engine-tracker.c.
Example:
--- 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,
It is a little different in nautilus 44, but essentially the same.
A quick and perhaps inelegant fix for nautilus 45.2
--- 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
There is probably a more elegant way to do this, but
the hack works and the performance is good, even searching against an 8TB fs of old fashioned spinning disks .
Enjoy!