This does not work with FTP.
The reason is that FTP is a protocol for listing and transferring files only. Nothing more, nothing less. You can get the name of a file, or list a folder's files, or you can transfer it to your machine. You can't, however, peek into the file.
Searching the contents of the file would be a much more complicated task than just serving it. FTP is not designed to do this and will never allow this.
Do it over SSH if you can.
If you have access over SSH, you can send a remote command that would allow you to search within files. Download Cyberduck.app and connect to the server.
Then send a command using Option-Cmd-C.
grep -ri "something" /remote/folder
This would search for "something" within
/remote/folder and all of its children.
Have a look at some grep examples (here or here) to see how you could use it.