title: Nest: how are you supposed to deal with the highlights in c#
body: <p>I'm trying to search "everything" in an index for a search term, and display the context with the terms highlighted.  I get an appropriate set of documents returned, but cannot figure out how I'm supposed to handle the highlighting in code.  </p>
  
  <p>At this point i'm just trying to dump it into a literal, and the below code "kinda sorta" works, but it doesn't seem to have highlights for every document, and just doesn't feel right.  I have found many examples on how to do the query with highlights, but i haven't found any example of how to do anything with displaying the results.  Any suggestions?  Thanks!</p>
  
  <pre><code>    var searchResults = client.Search&lt;Document&gt;(s =&gt; s.Query(qs =&gt; qs.QueryString(q =&gt; q.Query(stringsearch))).Highlight(h =&gt; h
              .PreTags("&lt;b&gt;")
              .PostTags("&lt;/b&gt;")
              .OnFields(
                f =&gt; f
                  .OnField("*")
                  .PreTags("&lt;em&gt;")
                  .PostTags("&lt;/em&gt;")
              )
          ));
  
      Literal1.Text = "";
  
      foreach(var h in searchResults.Hits)
      {
          foreach(var hh in h.Highlights)
          {
              foreach(var hhh in hh.Value.Highlights)
              {
                  Literal1.Text += hhh+@"&lt;br&gt;";
              }
          }
      }
  </code></pre>