Reputation: 5308
I am planning to upload user's word documents in MongoDB using GridFS. I have to implement following functionality.
When admin type a string and hit search in administration app, i have to list all word documents where the contents contain the search string. I have to search across all user's documents.
Is there a way to achieve this in MongoDB? If not, what is the best way to achieve this?
Upvotes: 0
Views: 639
Reputation: 36784
In MongoDB the best you can do is a binary match of your search phrase against the contents in GridFS, but in Word documents you will probably not find this phrase as it's likely compressed.
I think you would be much better off using a dedicated search solution such as Solr. Solr even allows you to extract text from Word documents and allows you to search for any sort of phrase in a quite complete search language. Have a look at http://wiki.apache.org/solr/ExtractingRequestHandler for dealing with Word documents f.e.
Upvotes: 1