I have a file that can be shown with the following command.
$ mdimport -d2 file.pdf
But when I use the following command to search for the file. The file won't show up immediately.
mdfind -onlyin dir_the_file_is_in "(kMDItemTextContent=='searchterm'c) && (kMDItemFSName=='*.pdf')"
After I wait for sometime since I open it with Acrobat, then the above
mdfind command will find it. Furthermore, I actually can not tell whether it is because I used Acrobat to open the file or because I used
mdimport -d2 file.pdf so that the file can be found as I did both.
Does anybody know why this is the case?