Rumboogy22

Q: 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

Close

Q: Old problem with Spotlight and Word .docx files

  • All replies
  • Helpful answers

Previous Page 2 of 3 last Next
  • by bjfromvelp,

    bjfromvelp bjfromvelp Feb 10, 2016 3:45 PM in response to fiberhome
    Level 1 (0 points)
    Feb 10, 2016 3:45 PM in response to fiberhome

    Turned out today that all file names were found after the changes I made, but not all files could be searched on content. I had to change the permissions of my documents folder: "everyone" to read&write; now all files can be searched. Just can't explain why I had to do this. Also can't explain why only the doc/docx files couldn't be searched... But it seems to work completely now.

  • by livins2,

    livins2 livins2 Mar 11, 2016 4:25 PM in response to bjfromvelp
    Level 1 (0 points)
    Mar 11, 2016 4:25 PM in response to bjfromvelp

    I may have a simpler solution, or at least a band-aid that will get the system working the way it should. Copy RichText.mdimporter and paste it into the folder where Microsoft Office.mdimporter is located. Then reindex your entire hard drive. I did this, and afterward everything seems to be working the way it should, at least for now.

     

    I think this is working because RichText.mdimporter is essentially bypassing Microsoft Office.mdimporter. When I tried using terminal to manually reindex a .docx file using Microsoft Office.mdimporter, I got an error message. When I tried using terminal to manually reindex the same file using RichText.mdimporter, it worked fine.

  • by VikingOSX,

    VikingOSX VikingOSX Mar 11, 2016 5:03 PM in response to Rumboogy22
    Level 7 (20,804 points)
    Mac OS X
    Mar 11, 2016 5:03 PM in response to Rumboogy22

    Since El Capitan was released, all Apple (TextEdit, Pages v5.6+), and LibreOffice v5.1.0.3 are writing out Word .docx files as item kind “3rd party formats.” You can't find them by using traditional Spotlight/Finder search words as kind:word, or kind:microsoft. You will need kind:3rd.

  • by nathalie123,

    nathalie123 nathalie123 May 16, 2016 9:22 AM in response to Rumboogy22
    Level 1 (8 points)
    May 16, 2016 9:22 AM in response to Rumboogy22

    Hi Rumboogy22,

    I know this is an old post, but after endless researching and trying different "fixes", the script you posted in Dec. 2015 is the ONLY thing that works consistently well for me. However, I am still unable to figure out how to automate the script. I tried an app called "LaunchControl" but couldn't get it to work... You mentioned something about "crontab" - if you have the time, could you please post (or send me) detailed instructions on how to set it up? Thanks a lot!

  • by jpdemers,

    jpdemers jpdemers May 18, 2016 11:26 AM in response to bjfromvelp
    Level 1 (41 points)
    Mac OS X
    May 18, 2016 11:26 AM in response to bjfromvelp

    That worked for me - Office 2008, running under El Capitan.  Never thought to just ditch the thing!

    (It may not be an issue for new installations of Office, which might not saddle the user with the Office mdimporter.)

  • by jpdemers,

    jpdemers jpdemers May 18, 2016 11:32 AM in response to Rumboogy22
    Level 1 (41 points)
    Mac OS X
    May 18, 2016 11:32 AM in response to Rumboogy22

    I was referring to different versions of a document - the original draft, and revisions 2 through 6.

    Spotlight was finding the older ones, but not the newer ones - all in the same folder, all containing the searched-for term.  Forcing Spotlight to index the .docx files worked, but relying on Spotlight to update the index on its own did not work.  In any event, ditching the Office mdimporter did the trick.

  • by mistersharma,

    mistersharma mistersharma Jun 3, 2016 4:40 AM in response to Rumboogy22
    Level 1 (4 points)
    Mac OS X
    Jun 3, 2016 4:40 AM in response to Rumboogy22

    Hello! Im still having problems with this, even after doing the different steps. Any help?

  • by jpdemers,

    jpdemers jpdemers Jun 5, 2016 2:00 AM in response to Rumboogy22
    Level 1 (41 points)
    Mac OS X
    Jun 5, 2016 2:00 AM in response to Rumboogy22

    [deleted]

  • by jpdemers,

    jpdemers jpdemers Jun 5, 2016 2:11 AM in response to mistersharma
    Level 1 (41 points)
    Mac OS X
    Jun 5, 2016 2:11 AM in response to mistersharma

    Did you carry out all of the following steps?

    Remove Microsoft Office.mdimporter from /Library/Spotlight - stash it in a folder, in case you ever need it.

    Make sure that Rich Text.mdimporter is present.

    Open preferences, and add your entire HD to the privacy tab of spotlight preferences

    Close preferences

    Reboot (shouldn't really be necessary, but it can't hurt.)

    Open preferences, and remove the HD from the privacy tab of spotlight preferences

    Wait while Spotlight re-indexes your disk.  This could take quite a while.


    That should do it.


    One of the posters above found it necessary to change the permissions of his documents folder to allow "everyone" to read & write.  Not true in my case, but your Mac might have the same quirk.  I'd be sure file sharing was turned off, if I had to leave the permissions in that state.


    If it's still not working follow Rumboogy22's advice and run this test in Terminal:

    Terminal command:

    mdimport -d1 /Users/YourUserName/FolderName/DocName.docx

    The bolded pathname should be for a .docx file somewhere in your user folder. You can just type "mdimport -d1 " (note the final space), and drag the file icon into the terminal window to create the pathname.

     

    The output of the command should look much like this:

    2015-12-29 00:59:38.755 mdimport[9479:543385] Imported '/Users/YourUserName/FolderName/DocName.docx' of type 'org.openxmlformats.wordprocessingml.document' with plugIn /System/Library/Spotlight/RichText.mdimporter.

     

    This should verify that Spotlight is (a) recognizing the file as an xml word processing document, and (b) using Rich Tex.mdimporter to open .docx files.

    If everything checks out, but Spotlight is still not indexing .docx files, you could try replacing Rich Text.mdimporter with a fresh copy from another Mac running the same OS.  I can't think of anything else to try beyond that, other than re-installing the OS itself.


  • by mistersharma,

    mistersharma mistersharma Jun 6, 2016 3:42 AM in response to jpdemers
    Level 1 (4 points)
    Mac OS X
    Jun 6, 2016 3:42 AM in response to jpdemers

    Thank u so much! Problem is that i cant find Rich Text.mdimporter.. can i download it from somewhere?

  • by fiberhome,

    fiberhome fiberhome Jul 5, 2016 6:33 AM in response to fiberhome
    Level 1 (4 points)
    Mac OS X
    Jul 5, 2016 6:33 AM in response to fiberhome

    Applying bjfromvelp's process helped for a while, but I now find that Spotlight is not indexing "doc" files. It seems to be indexing some docx files, but I suspect not all of them. I checked the Library/spotlight file and found the Microsoft Office.mdimporter file has not been replaced. Something else must be going on. Has anybody else seen this? I did update MS Office 2011 once or twice in since the last few months, and wonder if that did something, but I can't be sure.

  • by jpdemers,

    jpdemers jpdemers Jul 10, 2016 12:27 AM in response to mistersharma
    Level 1 (41 points)
    Mac OS X
    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.

  • by jpdemers,

    jpdemers jpdemers Jul 10, 2016 12:56 AM in response to fiberhome
    Level 1 (41 points)
    Mac OS X
    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.

  • by fiberhome,

    fiberhome fiberhome Jul 10, 2016 1:04 PM in response to jpdemers
    Level 1 (4 points)
    Mac OS X
    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?

  • by Peasedowner,

    Peasedowner Peasedowner Sep 11, 2016 7:58 AM in response to fiberhome
    Level 1 (4 points)
    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.

Previous Page 2 of 3 last Next