EDOC-1098: fix query support