Fix aea4af813756f132dc629820b6414d65f3649df5 implementation in case QueryType is OR