adds query terms to debug context