Finder (Spotlight) finds some XML files yet misses others in same directory

I have reindexed Spotlight per steps at https://support.apple.com/en-us/HT201716, but it didn't help.


I have several dirs, each with a few thousand ASCII XML files. Since upgrading to Mohave, I started noticing it wasn't finding some content in some files I know was there.


So I ran a test using two directories, dir A with 306 XML files and dir B with 3894 XML files. Dir content has not changed in past few weeks. My Finder preference is set to search only current dir, so in Finder I open the dir and type "version" (without quotes) into the finder search window. All of the XML files contain the word "version" as the first line as verified by running: grep -l "version" * | wc -l. This is the first line of every file:


<?xml version="1.0" encoding="UTF-8"?>


In dir A, Finder finds no files; it should find 306

In dir B, Finder only finds about 10% of the files; it should find 3894


What could be causing this? No idea if it's related to being an XML file or not.


Posted on Aug 27, 2019 4:42 PM

Reply

Similar questions

3 replies

Aug 27, 2019 7:00 PM in response to jimspot

Here is another trick for finding XML files. I have five .xml files in ~/Desktop/XML folder. Like you, I have my Finder Preferences to search in the current directory first. I change to my Desktop, and then issue the following command in the Finder search field:


name:.xml


It finds only the five XML files in the ~/Desktop/XML folder. If I switch from "Desktop" to This Mac, it finds 103 files in other locations.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Finder (Spotlight) finds some XML files yet misses others in same directory

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