SOC-4219: Add a case when search query exists