SONAR-4716 Fix query