Search Everywhere can't find files

My global desktop search (the thing when I hit the Super key and start typing) can’t seem to find files (other than those in ~/.local/share/recently-used.xbel). My workaround is to search from the Files/Nautilus app itself using “Search Current Folder” – that shows me all results I expect.

“Search Everywhere” in the Files app never returns anything, not even entries in ~/.local/share/recently-used.xbel. It instantly returns “No results found”.

tracker3 search readme.md has tons of matches, but all these are full text search matches, none are filenames.

I think there are plenty of, e.g. Readme.md files in tracker3’s index, but none are returned. I don’t know the architecture of all this, I’m guessing based on tracker3 info ~/git/meonkeys/ow/Readme.md returning a lot of lines (file:/// and urn:fileid entries), so I assume that means that some necessary stuff is in the index? Also du -hs ~/.cache/tracker3/ returns 663M, for what that’s worth.

When I initiate a desktop search for readme.md, it looks like it is trying to fetch search results from Files/Nautilus:

$ journalctl --user --grep 'nautilus|files' -f
Dec 13 14:05:16 pickle dbus-daemon[11330]: [session uid=1000 pid=11330] Activating service name='org.gnome.Nautilus' requested by ':1.41' (uid=1000 pid=11798 comm="/usr/bin/gnome-shell" label="unconfined")
Dec 13 14:05:16 pickle nautilus[220076]: Connecting to org.freedesktop.Tracker3.Miner.Files
Dec 13 14:05:16 pickle dbus-daemon[11330]: [session uid=1000 pid=11330] Successfully activated service 'org.gnome.Nautilus'

I also tried this tool but it doesn’t seem to reveal anything new (and returns no results):

$ ./gnome-search-cli.py --provider org.gnome.Nautilus --debug readme.md
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/org.gnome.Calculator-search-provider.ini
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/org.gnome.Calendar.search-provider.ini
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/seahorse-search-provider.ini
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/gnome-terminal-search-provider.ini
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/org.gnome.Nautilus.search-provider.ini
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/org.gnome.clocks.search-provider.ini
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/org.gnome.Contacts.search-provider.ini
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/org.gnome.Settings.search-provider.ini
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/org.gnome.Software-search-provider.ini
DEBUG:root:Reading /usr/share/gnome-shell/search-providers/org.gnome.Characters.search-provider.ini
INFO:root:Searching Search provider org.gnome.Nautilus.desktop
DEBUG:root:org.gnome.Nautilus.desktop: Calling GetInitialResultSet()

I’m using gnome shell 46.0 (came with 64-bit ubuntu 24.04 LTS desktop). Tracker is version 3.7.1.

~/.config/user-dirs.dirs contains:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/"

I should also note I have another machine with the same software and files (and settings, as far as I can tell) where global / desktop / Search Everywhere does work just like I’d expect. I’m probably missing some small config/software difference though, I just haven’t spotted it.

Hi, is the folder you want to search added in Settings > Search > Search Locations?

Yes. /org/freedesktop/tracker/miner/files/index-recursive-directories is set to ['&MUSIC', '&VIDEOS', '/home/adamm/Notes', '&DOCUMENTS', '/home/adamm/git', '/home/adamm/personal']

There are many files matching readme.md under ~/git and also in ~/Documents.

/org/freedesktop/tracker/miner/files/index-single-directories is set to the default value: ['$HOME', '&DOWNLOAD'].

/org/freedesktop/tracker/miner/files/ignored-directories is set to ['po', 'CVS', 'core-dumps', 'lost+found', '.git', 'venv', 'build', 'modules', 'node_modules', '__pycache__'].

/org/freedesktop/tracker/miner/files/ignored-directories-with-content is set to ['.trackerignore', '.hg', '.nomedia']

Note that ~/Documents is a symlink to ~/Nextcloud/Documents, but again, I have another computer set up almost identically (including that symlink) where searches do appear to work as expected.

I reindexed yesterday and now tracker3 search readme.md is finding files in ~/git and ~/personal, but not ~/Documents, strangely. That’s… better. The desktop search (super key, start typing) still returns only recent files from the Files app.

I think I was wrong about the symlink. I noticed, e.g. tracker3 search readme.md never showed anything in ~/Documents, so I changed the config to crawl ~/Nextcloud/Documents instead and now I’m seeing matches in there. So I guess that means tracker3 won’t descend into ~/Documents if it is a symlink.

I can’t explain why, on the other computer, I still have it set to crawl ~/Documents (the symlink) and when I do the desktop “super key → start typing” search I see matches within ~/Documents. But tracker3 search readme.md on that computer does not show matches in ~/Documents. Maybe there’s some stale data?

What exactly happens when I hit the super key and start typing? Is there an easy way to trace that? It’s like that and Nautilus’s “Search Everywhere” are still somehow broken/disconnected.

Nautlus’ “Search Everywhere” uses the same search engines as the shell search provider. However the shell search also considers other places (but not their contents) on top of that: bookmarks, mounts, certain special directories.

Tracing this isn’t really easy, you could try running nautilus in gdb and setup appropriate debug points in nautilus-shell-search-provider.c

I think you need to configure Files as a search provider in the Settings, there should be something to configure Search somewhere :thinking: