If you are using iPhone from a long time than it is quite possible that you might have faced issue with search in message and iMessage that when you try to search for a word in messages iPhone will show result only from few chats but not from all. Specially iPhone will not search in group chats. It is well known that search in iMessage is terrible, making searching text in iMessage poor. Even the latest iOS 11 have search issue in iPhone X/8.
The iPhone X and iPhone 8,7 are also reported with such issues, infact are reported with bigger issue like any letter or word entered in search of iMessage, turns up with no search results.
Apple needs to look this issue seriously in upcoming releases if iOS as many third party app developers has make similar feature working withour any complaints. Like searching for a message within iMessage so bad, yet searching within WhatsApp is flawless.
How to fix unable to search text in iMessage /message app:
There are few workaround and fix available that you may try to fix the issue, as listed below:
Fix 1: Reset search settings
In your iPhone, Go to setting Settings>Siri&Search and turn on/off search for messages. All should be working again in iMessage. If it still does not work closed settings, reopened settings and turn it back on.
Fix 2: Clear iMessage account from other device
If you are unable to search in the message or iMessage apps after upgrading your iPhone to other one like iPhone X. It is observed that it was only happening when using iMessage on another device. In this case you should try to wipe out your old iphone that still uses the same text messages, as soon as you factory reset the old iPhone it should work on new iPhone.