Jump to content

Search for specific words in documents in google drive?


Recommended Posts

Posted

Is it possible to Search for specific words in documents in google drive?

 

Even using google's native search, it does not locate some words that I am searching for. Is it possible to do this with the Google Drive workflow?

Thank you!

 

I have tried searching this on the forum and generally on the internet. It says you can locate files, but did not find anything specifying searching within a document to find specific words within a google doc. Thank you!!!

Posted

Welcome @kaleowatts,

 

The Google Drive workflow indeed only searches paths. It exists because historically Google Drive hasn’t cooperated with Spotlight (whose database Alfred checks). Most people use Google Drive in stream mode, meaning files aren’t downloaded locally. Meaning also it’s not possible to search their contents (because they do not exist on disk). Even if they were local, keeping a database of all of that could reach humongous sizes, so the workflow purposefully only checks names.


Now, that doesn’t mean it’s not doable. It might be, for example by using Google Drive’s web API. But if Google itself, whose business is search and owns Google Drive isn’t finding those files, then the API probably wouldn’t either. If the native search can’t do it, you can see how that could be a problem for third-parties. Your first step should be to contact Google for help with locating those files, they’ll be more equipped than anyone else to explain why they aren’t matched.

Posted

Thank you so much vitor for that very detailed answer. Would be nice if we could grant Alfred access to a given folder to index, at least, so that it could search a specific range of documents. For example, as a medical student, this would be priceless to quickly locate my notes an a given topic. I figured Alfred would do a much better job than Google would based on its superiority at indexing and locating OSX files. 

Best

Posted

It’s not a matter of access. Alfred can already see what Spotlight does and find files based on their content but first files have to be available (which they won’t if you use streaming) and then they have to be indexable (which historically has been an issue with Google Drive). If Google, who specialises on search, has trouble finding files on their own service, that’s a barrier.

Posted (edited)

I just tried and there are no issues with indexing for files with local copy. Alfred finds txt files by content with 'in' command. I'm using official gdrive app.

 

Actually not all files are indexed. You are right

Edited by skynetua
Posted (edited)
2 hours ago, vitor said:

and find files based on their content but first files have to be available

9 minutes ago, skynetua said:

indexing for files with local copy

To be specific, I was not referring to files but am referring to searching for the words within a google document.

 

For example, I can easily type command + F and find the word in the document, but google cannot on many instances for medical terminology (when searching from drive.google.com). 

 

It would be nice if we could just give Alfred access to a few folders and have it index all the words within, as many users were flustered by the loss of spotlight access to google drive. 

 

An alternative is to use MS Word, but for a medical student, google docs are much preferable to word for rapid hyperlinks within and across documents, and countless other functionality more efficient than in word. The search is a worthwhile feature that I think would prompt many users to purchase Alfred, as I was allured by the Google Drive workflow, however I need the word search (not merely the file search), and I think that is what many users are looking for. 

 

Thanks for your help!

Edited by kaleowatts
Posted (edited)

As Vítor mentioned it should be possible via the Google Drive API. It will require that you create a service for the application, I described this procedure for my gsheets workflow. The application would reproduce a web search in the google drive search box so, as Vítor says, won't find files that are not found there. Other approaches might work in your case, for example creating a local index. Do you have a few very large documents, or many short documents? Are they edited often, or rarely? 

Edited by giovanni
Posted (edited)

@kaleowatts I drafted a workflow to search your Google Drive. You will need to create a service in your Google account (a bit tedious, but only needed once), and share the documents (or folders) you want to search with that service. Instructions are in the README. 

Let me know if it works for you!

 

Download from Github

image.thumb.png.cd38f9452e9a4a18c4167c229f05ccd0.png

Edited by giovanni

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...