Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Old problem with Spotlight and Word .docx files

There is an old problem with Spotlight not finding Word .docx files. You can find old discussions about this from 2008. But despite this problem being ancient it has never been solved.


The essence of the issue is that Spotlight relies on a variety of software modules to index files. Spotlight chooses the appropriate module to index each different type of file. These indexing modules all have the file suffix .mdimporter. There name of the module for indexing Microsoft office files is "Microsoft Office.mdimporter" and it can be found with some other .mdimporter modules at /Library/Spotlight/. The"Microsoft Office.mdimporter" module has copyright info from Microsoft inside its package so we know who wrote it. But this module is included with all new Macs by Apple. Perhaps this is why this problem has never been fixed - the software is written by Microsoft but delivered by Apple.


The symptoms of the problem are that Spotlight will not find content in some .docx files. It is not clear why it fails on some .docx files but not on others. This problem does not seem to affect other Microsoft formats such as .doc, .xls, .xlsx, etc.


Given that Apple wants to sell Macs to business, and that businesses make heavy use of MS Office typically, one would think that this would have been a priority to fix. But given that this problem is 7 years old and still unsolved I guess not.


Any suggestions on work-arounds would be welcome.

OS X Mountain Lion, latest release of OS X

Posted on Dec 7, 2015 11:09 AM

Reply
39 replies

Jul 10, 2016 12:27 AM in response to mistersharma

It comes with the Mac OS ... odd that you don't have it. It should be in System/Library/Spotlight.

You should be able to copy it from another Mac, preferably one running the same version of the OS.


It appears that while RichText.mdimporter enables indexing of .docx files, it does not index .doc files. Microsoft Office.mdimporter does that job, and if you remove it, as recommended here, you'll find that .doc files are not being indexed by content... and the re-indexing of the whole drive will wipe out the existing .doc file indexes.

Jul 10, 2016 12:56 AM in response to fiberhome

If you want .doc files indexed, you need the MIcrosoft Office.mdimporter.

The problem, for those of us with this issue, is that it seems to prevent proper operation of RichText.mdimporter, which you need to index .docx files.

The solution we've come up with is to delete Mircosoft Office.mdimporter, be sure RichText.mdimporter is present, and force a re-indexing. That should get all .docx files indexed. Then run the following command in Terminal:


find ~ -type f -name '*.doc' -print -exec mdimport -d1 {} \;


Terminal will show the indexing as it progresses. Now you have all .docx and .doc files indexed. Note that any .doc files created in the future will not be indexed. If you don't consistently save new material in the .docx format, or if you download or receive .doc files, you'll need to re-run that command from time to time. You'll also need to run the command anytime you force a re-indexing.

Jul 10, 2016 1:04 PM in response to jpdemers

There may be multiple problems here. I started out to complain that I also could not find the Rich Text.mdimporter.. file because it was not in the "library/spotlight" folder on the external hard drive I am using to run my Mac. But when I looked more closely at the instructions I see an ambiguity. Some refer to the "System/Library/Spotlight" folder and some to simply the "Library/Spotlight" folder. The RichText.mdimporter file exists in the "System/Library/Spotlight" folder but not in the "Library/Spotlight" folder that exists at the same level as the "system" and "applications" folder.

At the moment, I find the following files in the "Library/Spotlight" folder

GBSpotlightImporter.mdimporter

iBooksAuthor.mdimporter

iWork.mdimporter

LogicPro.mdimporter

Microsoft Office.mdimporter (just replaced)


I also copied the Microsoft Office.mdimporter file into the "System/Library/Spotlight" folder. That contains a lot more folders, but does not contain any of the other files in the "Library/Spotlight/" folder. Could some applications be inserting their 'mdimporter' files into the wrong folder? Or would either location work?

Sep 11, 2016 7:58 AM in response to fiberhome

I have been having exactly this problem for the last 3 years and I have tried many options. However, I followed what bjfromvelp said above and yes Spotlight is now working as it should. I have done a number of tests and all is OK. I am using a 15" MacBook with El Capitan 10.11.6 and the latest Microsoft Word for Mac 2011 Vs 14.6.7. I can't say how pleased I am with the advice given. I was previously using a script to keep re-indexing and now I don't need to. Thanks again.

Sep 20, 2016 1:26 PM in response to fiberhome

My problem may be more fundamental than fiberhome's. In my system/library/spotlight folder, there is no richtext.mdimporter file. In my regular (non-system) library folder, there is no spotlight folder at all. So two questions for anyone who is still following this thread and can help: (1) Where can I find richtext.mdimporter if it's not already in the spotlight folder, and, if I can find it somewhere, can I simply move it into the system/library/spotlight folder? (2) Should there be a spotlight folder in the regular library folder, and is there something seriously wrong if, as in my case, it's not there?


If you get the impression that I don't know what I'm talking about, you're right! I just know that I'm deeply and persistently frustrated by my Mac's inability to index docx files.

Nov 13, 2016 10:36 AM in response to marco42

I can't believe I have this problem. I am on Sierra, latest update (10.12.1) and Spotlight cannot find my .docx contents.


I am so fed up of everything Microsoft. I could blame Apple, but almost everytime I have had a hangup or a problem with my Mac Microsoft was in the middle.


My brand new Word 360 cannot create accented vowels, by the way, despite hours calling Microsoft support.


I "solved" this by using Terminal to run the mdimport command for my existing .docx documents and from now on I will never use the .docx extension anymore.


But if this in the end an Apple problem, please, Apple, do fix it. Thanks.

Old problem with Spotlight and Word .docx files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.