fix(query-interface/generator): make sure index queries are properly escapes (closes #1943)