On my MBP running Mojave (with SSD drive), I noticed that when searching for a file using
mdfind utility I get different results than when doing the same search from Finder. No location/path restrictions were used.
Can someone explain to me how this could be? The results should have been 3 .odt files and 1 .mp3 but mdfind only lists the .odt files.
Reindexing fixed the problem. How can I prevent this from happening again? Is there some regular maintenance task I could run to make sure the index is up to date? Or do I simply force a reindex once a week?
EDIT: The names of the files I was searching start with 6182.
The search from the Terminal was:
$ mdfind -name 6182
As for Finder, I just entered 6182 and made sure This Mac was selected.