core: refactor SearchQuery class

Small refactorings - simplify expression,
remove redundant local var and move assignment next to its usage.

Change-Id: Ie4c2e8dcc0e611dbba1667709e9601337979a136
Signed-off-by: Alissa Bonas <abonas@redhat.com>