Clicky

Drablak
I have a strange problem. I'm searching into a folder with markdown files for a specific word ("fighter"). The files represent chapters (chapter01.md, chapter02.md, etc.). In searching for the specific word in the text of any of those files, I'm finding occurrences of the word in chapters 3, 4, 6, 7, 8, 9, and 10, but not in chapter 2 where there is the exact same word.

I don't see any differences in that file (the chapter 2 file) from the others. It's at the same location as the others, and I didn't include any other criteria for the search. I can't understand why it wouldn't find the many occurrences of the word in chapter 2.

Any thoughts?
0 0
houdah
Hi!

HoudahSpot searches the Spotlight index. This relies on importer plug-ins to extract text and metadata from various file types. Such importers are installed with the system and with third-party applications.

Text Preview in HoudahSpot happens to rely on the same Spotlight importer plug-ins to get text from files. Look at the chapter02.md in Text Preview and check if that text actually includes the word you are looking for.

Another way to see if the importer is working correctly:

1. Open /Applications/Utilities/Terminal.app
2. Paste in the following: "mdimport -d 3 -t " (with the trailing space, but without the quotes)
3. Now drag the chapter02.md from Finder to the Terminal window. This will add its path to the above command
4. Press the Return key

The file will be processed by the importer (without updating the Spotlight index). Terminal will show the data it got from the importer. This should have a value for kMDItemTextContent. That is the text that would be indexed by Spotlight.

Does it include the word you are looking for? If not, there is a problem with the file or the importer.


If all looks good so far, you can ask Spotlight to re-index the file:

1. Open /Applications/Utilities/Terminal.app
2. Paste in the following: "mdimport " (with the trailing space, but without the quotes)
3. Now drag the chapter02.md from Finder to the Terminal window. This will add its path to the above command
4. Press the Return key


Wait a few seconds and run the HoudahSpot search again. It is likely the file now shows up.
That would mean that Spotlight failed to catch the file when it was created or updated. This could be a one time bug. It could also mean that your Spotlight index is damaged.

Should you see this happen again, try re-indexing your drive:

1. Go to System Preferences > Spotlight > Privacy
2. Add your startup disk – not just individual folders – to the list
3. Wait a bit, to be sure the old Spotlight index is deleted
4. Remove the startup disk from the Privacy list
5. Leave the computer running overnight to rebuild the index


Houdah Software s. à r. l.
https://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Advanced file search utility
Tembo: Easy and effective file search
0 0
Drablak
Re-indexing the file did the trick. I'll re-index my drive this evening.

Thanks for the detailed help! [thumb]
0 0