Hi so I have just switched over to the s9 and have had the same problem. Try this as it worked for me.
The smiley face that appears in the message bar where you type is what you need to select. That will take you to the smiley you may want to use. Below will be the option the select gif. Select this and search by clicking on the magnifying glass.
It appears that the gif button on the main bit is only for trending gifs or to locate ones that are commonly searched for specific keywords.
It's all a bit silly and Samsung have definitely messed up. I hope this helps. I tried adding in screenshots but I can't seem to add images.
To be honest, since starting this thread a while back and despite all the best advice given, none of it worked. However Samsung updated the messaging app in December and this fixed it and since then I've had the Android Pie update and it has changed the stock messaging app and the GIF search works fine. So as far as I'm concerned the issue is fixed. Thanks for all the suggestions from everyone.
What phone do you have? Its NOT fixed on the S8 Plus. I have the latest version of 'Messages' for my device, 184.108.40.206. Also there has been no release of Android pie, at least not on Verizon for the S8 plus.
I don't think everyone commenting reads or sees all the previous images and posts about how many times people tried all the things and they just don't work for everyone. Maybe it's some weird software issue I don't have the tech knowledge to understand, but there are those of us here that just do not have the ability to search for gifs no matter what anyone says. The function is simply not there. I have just quit using the samsung keyboard all together and use the gboard. Not stellar but I don't have that problem or other weird hitches I had when using the samsung keyboard.
This is the solution that worked for me. I will add I also switched to the Samsung Neural keyboard, and that worked as well.
the Gkeyboard from bitmoji is awesome as well.
I have the same problem! So frustrating. Did you get an answer to this? Ives scrolled through replies and tried a few but nothing for me alot doesn't apply ... I have Samsung s7!x