TPS-728 [5.5.1]it throw error while clicking 'Relations' button in webUI(TMDM-7679)

TMDM-7679 Fix incorrect query building when keywords are of empty string

Cherry picked from commit bbf524360d24b9e3f8004296daa2845c36e4fa1d