GNOME Bugzilla – Bug 760366
Gnome Shell overview search doesn't return results on indexed paths outside user home
Last modified: 2018-06-28 17:42:37 UTC
Running Fedora 23, I have my OS and /home partitions on an SSD which appear are on /dev/sdb. I have a lot of movies and data on a spinning disk HDD which appears in the filesystem as /dev/sda.
I have set up the data folders in /dev/sda under tracker-preferences to be indexed and return results.
The search tool (which appears when I press Super button) only returns results for /home folder, none of the /data results appear.
However they are indexed by tracker because the results from /data appear when I search on the command line using tracker-search.
I found this thread on the Arch Linux forums showing another user has experienced this problem:
I tried all the steps suggested in that thread but did not get a resolution.
Yes, same issue in my system (Fedora 23), with home folders "Documents", "Pictures", "Music", "Download" and "Video" that are symlinks pointing to correspondent folder in /mnt/data.
With this scenario, I never had problems in recent years. This bug has only appeared in recent times.
I'd also like to see this fixed. I keep most of my large files on a dedicated data partition mounted at boot time (which is probably a common enough setup) located in /mnt/, and it would be nice to be able to search for files on that partition with the Overview search.
Currently, the only way around that limitation is to mount partitions in your own home directory. But then, other users won't be able to use the Overview to search for those files.
Another use case for this feature is being able to search for files that are shared by another user. For example, if userA owns /home/userA/sharedFiles and gives other users read/execute permissions for it, userB should be able to add that directory as a search path and use the Overview to search for files in it. Currently, this is not possible.
Some more points I'd like to mention:
-Tracker currently does not enter symbolic links when indexing (see Bug 726264), so making a symlink to a non-home directory and placing it in a Search Location under /home/<user>/ still won't make its files searchable in the Overview.
-Other search providers are able to find files under non-home locations just fine, so this is not a general limitation of the Overview search. An example is Documents, whose search provider can find files in any Search Location.
You can add new folders to be searched in the "Search" panel in GNOME Control Center.
That's true, but even when adding a folder in Control Center's "Search", its contents will not appear in Nautilus' Overview search results if that folder does not reside under /home/<current user>.
Quick steps to reproduce:
1. In a terminal, run:
sudo mkdir /home/spare && sudo chown <current-user>:<current-user> /home/spare
2. Place a document file (like a pdf or a Word/OpenOffice doc) in /home/spare and ~/Documents.
2. Enter the Control Center->Search.
2a. Enable "Documents" and "Files" as search providers.
2b. click the gear button in the bottom-right corner, and enable "Documents" as a search path in the "Places" tab, and add /home/spare as a search path in the "Other" tab.
3. Wait a minute to let Tracker index everything. Run 'tracker daemon' to check whether it's finished or not.
4. In the Overview, search for the file you added to /home/spare and ~/Documents.
The file will appear in the Overview as a Nautilus/Files search result, and as a Documents search result.
The file will only appear as a Documents search result. i.e. Documents does not require files to be under ~, but Nautilus does.
weird, thanks for testing. We just send tracker queries, so I'm not sure what's going on. Something for our search expert, Alex.
*** Bug 710786 has been marked as a duplicate of this bug. ***
Looking at the code in nautlus-shell-search-provider.c, it seems that the user's home is indeed the scope of the search:
home = g_file_new_for_path (g_get_home_dir ());
nautilus_query_set_location (query, home);
I wonder if we should just fire the tracker search for the shell search case, and don't limit it to home then.
I think that is the correct and expected behavior, yes.
Is it possible to issue a "generic" query, without a set location?
To make it clear, I mean not doing a recursive search in the directories manually, and only use tracker search.
Using only tracker, I think so yes.
As of Tracker 2.0 and Gnome 3.26, the Overview Search finds files in linked locations, as long as the link is under $HOME. So for example, linking $HOME/ExtraFiles to /mnt/HDD (and setting the former as a Search Location) would let the contents of /mnt/HDD to be searchable in the Overview.
From what I can tell, this is possible because Tracker now recurses into symlinks.
However, setting a non-home folder as a Search Location still doesn't let its contents appear in search results. So for the above example, setting /mnt/HDD itself as a Search Location won't make its contents appear in search results. The only way to make it work is for a link under $HOME to point to it.
Still, this is a big improvement!
Reposted in GitLab: https://gitlab.gnome.org/GNOME/nautilus/issues/502