Notes app search is not finding some notes

I am using my notes app on OSX 10.11.5 and iOS 8. For the most part, things are working, but I am noticing that many of my older notes are not searchable. When I type something in the search box, these older notes do not appear in search results even if there is a match. However, if I edit a note or create a new one, it is fully searchable.

My guess is that somehow the search indexes for my notes got corrupted. Is there any way to fix this or rebuild the indexes?


Solution 1:

If your notes are in iCloud, make a local backup. Then in iCloud settings uncheck Notes. Your Notes will all be removed. Now turn Notes back on. They should all return and this force an index rebuild.

Solution 2:

Much quicker way of fixing this is just to make a new iCloud notes folder, move all your notes into that and back again. This seems to rebuild the index- you can then get rid of the new folder. This is useful if like me you don't have a quick option to back up your notes separately.

Solution 3:

You should try reindexing spotlight on your mac. In terminal type sudo mdutil -E / and you will be prompted for your password, this can take some time though depending on your drive speed

Solution 4:

Notes are stored in under Library/Containers/com.apple.Notes in your user folder. You can force just the notes to be reindexed by Spotlight using the following command in the Terminal:

mdimport ~/Library/Containers/com.apple.Notes

Tested on macOS 10.11.