Actually this error occurred after I updated my os to Mojave. Earlier it was working fine. I'm using a MacBook Pro 2015 model.
I am searching in pdf files containing texts.
I've tried the solutions provided over internet, like closing and opening it again.
Searching works fine when I open the same file in Adobe Reader.