Jump to content

Google Drive Search (via Google Drive File Stream)


Recommended Posts

This workflow searches Google Drive via the Google Drive File Stream app. Currently, Spotlight is the main method for searching but is unreliable. (It would be great to get some feedback on why this is.) As a backup, the user has the option to use a file index created by an included Ruby script to search - this is more reliable but also much slower. Feedback is welcome!

 

http://www.packal.org/workflow/google-drive-search

Link to comment
  • 2 months later...

Thanks! Glad it's working for you.

 

To open files in Google Drive:

  • Google Doc extensions (.gdoc, .gsheet, etc.) should open in Google Drive automatically, as long as they're set to open with the Google Drive File Stream app (which they should be by default - it may also be called just "Google Drive" depending on the version you have).
  • Other files can be set to open in Google Drive by setting each file type to automatically open in "openInGoogleDrive.app", which is included in my Alfred workflow. In Alfred, right-click the workflow and then pick "Open in Finder" to see its location. Then for each file type that you want to open in Google Drive, set openInGoogleDrive.app as the default (detailed instructions at https://www.imore.com/how-set-mac-app-default-when-opening-file#file). Note that this is basically just a quick way of right-clicking the file and selecting "Open with Google Drive" - it's not the fastest or most elegant solution, but it's the only one I see available right now for non-Google file types.

Also FYI, at least on my end, Spotlight indexing is working very reliably after recent updates to Google Drive File Stream, so I don't even really need the Ruby backup anymore.

Link to comment
  • 1 month later...
  • 2 weeks later...

I have a MacBook and want to use Alfred to search google file stream mounted drive but the issue is that works some days and not other days 

 

I’m using the https://www.packal.org/workflow/google-drive-search workflow

 

I have to Trigger using the keyword (;), then hold control and press return to initialize.
 

It states Indexing must complete before searching will work.

 

This takes about 5-20 mins and sometimes it works and other times it doesn’t work. 

Any help would be fab !

 

it’s driving me mad as I need to search about 20 times a day.

 

Any help would be fab 😁

Link to comment
  • 1 month later...

Yes, it should work on Big Sur. If you're getting your Google Drive files to show up in a Spotlight search, then the workflow should work. A few troubleshooting steps I can think of:

  • If your Google Drive files do not appear in Spotlight, you need to re-index. Note that when I did this, it took a long time (~3-4 h) but it was a one-time fix. https://www.cultofmac.com/131619/fix-your-spotlight-search-results-by-forcing-spotlight-to-re-index-os-x-tips/
  • Check the workspace variables in Alfred to ensure it's looking at the correct location of your Google Drive files. (If I remember correctly, /Volumes/GoogleDrive is the default.)
  • When you're looking at the workspace variables, check out the comments on the left and make sure everything is configured as instructed.

I actually don't have a Mac anymore, so I unfortunately can't guide you with more detailed troubleshooting, but hopefully this helps.

Link to comment
  • 3 weeks later...
15 hours ago, stefano said:

Since the last update of google drive it seems that is not working anymore.

any idea?

 

I have the same problem since the update on Monday morning.

 

I'm running Alfred 4.3.4 [1229] on MacOS Big Sur (11.3)

 

The Files which I want to search are offline available in the Google Drive folder, like before. I also moved the Google Drive folder to my user's home directory, to make sure the path /volume/... is not causing this issue.

 

Now the directory is "~/Google Drive - AufBau

 

Alfred_Preferences_and_Shared_drives.thumb.png.2064cf55ab7fea670e9203129ea0d044.png

 

I tried the "File Search Troubleshooting" (Help>Troubleshooting>File Search Troubleshooting) with the following result

 

Starting Diagnostics...

File: '50_Kunden-Projekte'
Path: '/Users/henryauffahrt/Google Drive - AufBau/Shared drives'

-----------------------------------------------------------

Check file cache database...

 File cache integrity is ok

-----------------------------------------------------------

Check if file is readable...

 Alfred has permissions to read this file.

-----------------------------------------------------------

Check if volume '/' is indexed by macOS...

 Indexing is enabled on this drive

-----------------------------------------------------------

Check direct file metadata...

 Direct metadata available

Display Name: 50_Kunden-Projekte
 Other Names: 
Content Type: public.folder
   Last Used: 2021-07-20 07:02:23 +0000

-----------------------------------------------------------

Check mdls file metadata...

 macOS metadata missing essential items

kMDItemFSContentChangeDate = 2021-07-20 07:02:23 +0000
kMDItemFSCreationDate      = 1970-01-01 00:00:00 +0000
kMDItemFSCreatorCode       = ""
kMDItemFSFinderFlags       = 1024
kMDItemFSHasCustomIcon     = 1
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery      = 0
kMDItemFSLabel             = 0
kMDItemFSName              = "50_Kunden-Projekte"
kMDItemFSNodeCount         = 0
kMDItemFSOwnerGroupID      = 20
kMDItemFSOwnerUserID       = 501
kMDItemFSSize              = 0
kMDItemFSTypeCode          = ""

-----------------------------------------------------------

 Troubleshooting failed

 

What I tried to solve the problem on my own:

Has anyone an Idea how to solve this problem? Is this a problem we should inform the Google Team about?

 

It is very annoying since I have ALL my files in this Google Workspace / Google Drive Accounts.

 

I appreciate any kind of help!

Henry

Link to comment

I don't think there's a real solution to this problem right now.

 

1) It's possible to get this workflow to work using these instructions, however this workflow will open all files in the browser (fine for Google Docs/Sheets etc, but sometimes you might want the file to open in finder).

 

2) It's possible to force index Google Drive by using these instructions, however I believe it will download all files offline. It won't work with "online only" files.

 

I've tried to open a ticket with Google via their Google Workspace support (and I encourage anyone else that pays for GSuite / Google Workspace to do the same!) So far, not very helpful.

Edited by alfredpanda
Link to comment
2 hours ago, alfredpanda said:

2) It's possible to force index Google Drive by using these instructions, however I believe it will download all files offline. It won't work with "online only" files.

This would be enough for me for the meantime. But I get an error message when using "mdutil -s" or "mdutil -i on"

 

This is the error message:

Error: unknown indexing state.

 

Any idea?

After trying as root I get now this error message:

Error: unable to perform operation.  (-407)
	Error: unknown indexing state.

 

Link to comment
  • 1 month later...
On 7/21/2021 at 3:17 PM, mediocentr0 said:

I also have two Google Drives on my system/finder. One of them is working just fine, perfectly searchable through Alfred/Spotlight. The other does not work at all. I'm also on Alfred 4.3.4.

 

I have the same problem, one Google drive is indexed in both Spotlight and Alfred, while the other isn’t; both are loaded via Google Stream.

 

Starting Diagnostics...

File: '2021 Aug CCC Fri - Colleen.gslides'
Path: '/Volumes/GoogleDrive/My Drive/My Placewise Drive/My Placewise/Docs/Leadership/IDEO/Cultivating Creative Collaboration/Lesson 1 – '

-----------------------------------------------------------

Check file cache database...

File cache integrity is ok

-----------------------------------------------------------

Check if file is readable...

Alfred has permissions to read this file.

-----------------------------------------------------------

Check if volume '/Volumes/GoogleDrive/' is indexed by macOS...

⚠️ Indexing may not be enabled on this drive

/System/Volumes/Data/Volumes/GoogleDrive:
    Indexing disabled.

-----------------------------------------------------------

Check direct file metadata...

Direct metadata available

Display Name: 2021 Aug CCC Fri - Colleen.gslides
 Other Names: 
Content Type: com.google.gslides
   Last Used: 2021-09-03 21:26:17 +0000

-----------------------------------------------------------

Check mdls file metadata...

macOS metadata missing essential items

kMDItemFSContentChangeDate = 2021-09-03 21:26:17 +0000
kMDItemFSCreationDate      = 1970-01-01 00:00:00 +0000
kMDItemFSCreatorCode       = ""
kMDItemFSFinderFlags       = 0
kMDItemFSHasCustomIcon     = 0
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery      = 0
kMDItemFSLabel             = 0
kMDItemFSName              = "2021 Aug CCC Fri - Colleen.gslides"
kMDItemFSNodeCount         = 151
kMDItemFSOwnerGroupID      = 20
kMDItemFSOwnerUserID       = 501
kMDItemFSSize              = 151
kMDItemFSTypeCode          = ""

-----------------------------------------------------------

Troubleshooting failed
 

2095818007_Screenshot2021-09-05at14_00_41.thumb.png.67e01b5c8a2cf6bc066953144bb5dda7.png

Edited by Kaske
Link to comment

The solution is here

 

https://superuser.com/questions/1663797/google-drive-files-not-appearing-in-spotlight-and-alfred-after-update

 

You have to manually enable Spotlight indexing again. Open a Terminal window and type:

sudo mdutil -i on /Volumes/GoogleDrive*

Worked for me on MAC OS Big Sur 11.5.2. Just wait 5 min and the files should show up. Of course, you have to add /Volumes/GoogleDrive/MyDrive to your search scope first.

 

Capture d’écran 2021-09-08 à 16.39.31.png

Capture d’écran 2021-09-08 à 16.39.16.png

Link to comment

Confirming that this is the case — you will have to reindex each time you restart, and depending on the size of your drives it may take a while.

 

However, since I’m restarting my computer relatively rarely (max. once in a couple of days), it still pays off for me to reindex it. Since I don’t have a huge no. of files over there it’s finished in a couple of minutes.

 

Not a solution, but definitely better with it than without it.

Edited by Kaske
Link to comment
  • 1 month later...

Hi guys, new here, because I haven't had any problems with Alfred so far. Yesterday after updating to Monterey my system is no longer indexing Google Drive. I'm not sure if anyone ever had a solution to this yet. mdutil won't turn it on either. Whatever I do it just keeps saying "Indexing and searching disabled" I really need to get this feature back because I'm constantly looking up files for my workflow. Any suggestsions?

 

Thanks!

Link to comment
3 hours ago, archelium said:

Hi guys, new here, because I haven't had any problems with Alfred so far. Yesterday after updating to Monterey my system is no longer indexing Google Drive. I'm not sure if anyone ever had a solution to this yet. mdutil won't turn it on either. Whatever I do it just keeps saying "Indexing and searching disabled" I really need to get this feature back because I'm constantly looking up files for my workflow. Any suggestsions?

 

Thanks!

 

It seems it doesn’t have to do with updating to Monterey as it stopped working for me on Big Sur a couple of days ago. 

Edited by Kaske
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...