I had this issue as well and I was able to fix it! I figured out that for me, it was because not all of my iMessages had downloaded from iCloud. This is how I fixed it:
1. Before bed, I put my phone on the charger and was prepared not to use it for the rest of the night
2. Settings —> Apple ID, iCloud+, Media & Purchases (at the top) —> iCloud —> Show All (under Apps Using iCloud) —> Messages —> toggle off “Sync this iPhone” —> click “Disable and Download Messages” —> wait a minute or so, then toggle back on “Sync this iPhone”
3. Open iMessages app (there should be a message at the bottom of the screen that reads “Syncing with iCloud”)
4. Set my phone down without locking it (still plugged in) and didn’t touch it for the rest of the night (I don’t know if the “without locking it” part was necessary, it may still work if you lock the phone but this is what I did [I had my auto-lock display settings set to “Never”])
5. The next morning, I tried searching a word I know I’ve used a lot over the years and was able to see everything :)
Hope this helps! Good luck!