Check return value in search plugin

Thanks to Coverity Scan for picking this one up :)
Remove unsused variable