add query to index