Has anyone found/created a working solution for searching inside Google Docs using Spotlight (their contents, not just their names)?
Precipitate used to provide this functionality, but unfortunately no longer works and is no longer maintained.
Has anyone found/created a working solution for searching inside Google Docs using Spotlight (their contents, not just their names)?
Precipitate used to provide this functionality, but unfortunately no longer works and is no longer maintained.
I used a version of the answer supplied here with sudo mdutil -E /Volumes/[DriveName]
but first I had to make sure the Google Drive was mounted. So I did this:
sudo defaults write /Library/Preferences/com.google.drivefs.settings DefaultMountPoint '~/GoogleDrive'
Source: Configure Drive File Stream
It's very important that you don't put a space between Google Drive, as shown in the Google support column, because Terminal takes this as a hard return when entering the index command.
Then restart the Mac so the Google Drive is mounted as GoogleDrive, then:
sudo mdutil -E
Source: Terminal 101: Rebuild the Spotlight Index On the Fly
/Volumes/GoogleDrive
. I have enabled indexing by simply using sudo mdutil -E /Volumes/GoogleDrive
, no restart required.
Commented
Jun 19, 2019 at 2:23
I don't believe that Spotlight is technically able to index the content inside the Google Drive files, at least not files that were created from within Google Drive's web interface. For example, if I go to drive.google.com and create a new file (e.g. a Document) and insert some content (text) in the document, that new file representing that document will show up in my Mac's directory (i.e. /Users/myname/Google Drive/filename.gdoc). However if I take that file and open it in a text editor, I can see that the only content in the file is a link to the online file and some other information. The actual content of the google document is not in the file that's on my computer. Since the content of the document isn't in the file that's on my computer, there's nothing for Spotlight to index.
I think this is really unfortunate. The idea that I could use Spotlight to search through all of the files that I created online is really great, but it appears that Google Drive isn't downloading the content of the files, so there is nothing for Spotlight to index. As you noted Precipitate provided that functionality, but it doesn't work any more and it's no longer developed.
One non-spotlight alternative is to use the app Alfred to search:
Google Drive Search with Alfred App
All this really is is a shortcut to open your google drive in a web browser and initiate a search- not really what you (or I) want.
There is also an app called Found that is able to search Google Drive, but that company was purchased and the app is no longer being developed. I haven't tried the most recent version (which is from 2013), and the reviews on macupdate.com are mixed about its current functionality, but it might be worth a try.
I was confused at first because Spotlight didn't index that drive. However once I forced it to then I was able to search just fine. You can rebuild the index for a specific drive by following this tutorial.
sudo mdutil -E /Volumes/[DriveName]
There is a way. It is not pretty.
Use an app such as CloudPull that backs up Google Documents to your local drive. Then Spotlight will find the local copy. That gives you the name of the found file.
Use Google Drive to back up the shortcuts to the Google Documents that open the real document at Google.
Use Spotlight to search for the content you want, then take the found name and search for that to find the Google Documents shortcut and open that, in order to open the document at Google.
This happens automatically for any Google Drive folders/files you have synced locally using the GD app, because the files technically are on your system. The Spotlight results then become hyperlinks to the online Drive file, opening in your browser.
Just make sure anything you want to be able to search this way is saved in "My Drive" and that you have that, or whatever sub-folders you designate, syncing to your local directory.
TLDR: Spotlight indexing on Apple Silicon is not supported.
The answer below is from Google's documentation for Known Issues Spotlight in Google Drive for Desktop:
Spotlight—Drive for desktop versions later than version 47 don’t support Apple Spotlight indexing on Apple silicon devices, on macOS Monterey or later, or for Gmail accounts. You can use the integrated Google Drive search released in version 55 to search for files.
Workaround: For Google Workspace users there is a convenient search (magnifying glass) on the top menu bar when you click on the Google Drive icon.
If you are willing to try a Spotlight alternative, namely Alfred, you are good to go.
Alfred is technically a launcher/file-searcher, but it is capable of much more thanks to workflows. Without going into much detail it works basically as Spotlight: after a keyboard stroke you get a rectangle in the middle of the screen, where you can type your search query, and you get answers (much faster than Spotlight). There are really good tutorials for it, at the developers' website, and the learning curve is very shallow. To use workflows you need the Powerpack option which is not-free-of-charge (Alfred is), but I highly recommend this on time purchase.
Alfred uses the Spotlight index database to execute document searches. But I have found - and Oh man I've tried - that Spotlight is very unreliable working with network drives. And even if you mount google drive with CloudMounter or Mountainduck etc. you can not index it. (You can index a mounted network drive on the local network, but I only now a temporary solution. )
BUT Alfred, fortunately, can do a lot with workflows. And there is a workflow for google drive search. You can download it here. It is not a workaround, it is a native solution.
Simply double-click on the google_drive.alfredworkflow
file, and add it to Alfred. You will be asked probably to update it, but once you are done, you can search your google drive files in the Alfred window typing the letter d
and the search term
. You will see the hits in a dropdown list, you can select them, and they will open in the browser. It is lightning quick.
The latest versions of Google Drive for desktop include Spotlight integration, which supports both name & content indexing. It seems to be disabled by default for some unknown reason, so check your Google Drive preferences.