title: ElasticSearch: is it possible to highlight words in the query rather than the results
body: <p>We use ElasticSearch in a reverse manner from what I usually see. We store lots of small documents, usually 1 or 2 words, for example, Job Titles like "software engineering", "car mechanics", "architect", etc.</p>
  
  <p>Then we query with a longer string, for example a 1000 word Job Spec. This way we get all Job Titles present in the text of the Job Spec.</p>
  
  <p>It works well. But I was wondering whether I could get ElasticSearch to highlight the matching Job Titles in the Job Spec, i.e. highlight the results in the query. I have tried the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html" rel="nofollow noreferrer">highlight</a> keyword, but it doesn't highlight the query text, it highlights the results. I'm not sure how to get the query to be returned in the ElasticSearch response, let alone whether it can be highlighted.</p>
  
  <p>You might wonder why I need ElasticSearch to highlight the query, can't I just pick out all the results from the text and highlight them myself? Yes I can, but there's various things to think about that makes it hard such as stemming and stopword removal. for example "jquery" is stemmed to "jqueri" when doing the tokenising in ElasticSearch, so it's found as a result, but if I want to highlight it myself, I have to unstem it so it matches the original text. Elasticsearch also removes symbols, so <code>terms &amp; conditions</code> would become <code>terms conditions</code> which is problematic if I want to highlight it manually as I have to add back the "&amp;" symbol. There's a hundred other problem cases, hence the question about whether ElasticSearch can do it for me.</p>