How to make spotlight index specific files immediately

spotlight

I have a lot of new files and the CPU is quite busy. When I just add a new file, the command mdfind won't find it immediately. I have to wait for some time (definitely longer than the time needed to index the file as the file is small.)

Once the file is successfully indexed, then I move the file out of the current directly, mdfind -only . still find the moved file but the path printed in the output is outside of .. So the spotlight index is not updated completely.

Is there a way to force the index to be updated immediately as least for certain user specified files and directories? Thanks.

Best Answer

Something is messed up. Other than when your system has no index, spotlight indexes as the file is written - literally its part of the process writing the data.

The only exception I’m aware of is you can purge spotlight or have a new install and the system queues an index of all files. My recollection is that index only lags for files that were on the drive and new files are indexed immediately.

I don’t thing there’s a setting to change this so instead of wondering how to speed it up, run mddiagnose and work with support to see why your system isn’t caught up. (Or dig in to the diagnostics to see if you can spot the issue(s))