File searching from Activities Overview: How to blacklist directories?

I sometimes wish to find a file in my home directory and do so using the search bar in the Activities Overview. I also have like 4 samba network shares mounted under /run/media.

As already I have a slow wireless connection, Searching is considerably slower when it starts crawling these mounted network shares.

How do I prevent GNOME from searching these /run/media directories?
Using GNOME 50.1 on Fedora Linux
Also asked on Fedora forums: File searching from Activities Overview: How to blacklist directories? - Fedora Discussion

Localsearch will avoid indexing directories based on a couple conditions, like if there is a .nomedia file in the directory. For more you can check the documentation.

I’ve tried the following

  1. Creating a .nomedia file into my /run/media/scratch directory
  2. tried the ignored-directories dconf key
  • gsettings set org.freedesktop.Tracker3.Miner.Files ignored-directories “[‘po’, ‘CVS’, ‘core-dumps’, ‘lost+found’, ‘/run/media/scratch’]
  1. clearing localsearch index database
  • localsearch reset –filesystem

I did all of the above in order then rebooted.
Did not work, Search in Activities overview is still showing a Files section with files from subdirectories of /run/media/scratch directory

The Nautilus search provider also includes files from ~/.local/share/recently-used.xbel, i.e. files recently opened (in applications that support updating that file). As far as I know no recursive searching is involved in that. Maybe that’s where the results you are seeing are coming from.

I can confirm that recursive searching shouldn’t and very likely doesn’t happen when searching from the overview.