Fixes #3340: Bad logic for search queries on nodes with OR and regex leads to wrong results