title: c# elastic search nest how to output the document score
body: <p>I would like to output the score for each result from elastic search. But I'am unsure how I can get this.</p>
  
  <p>Below is my current code for running a query:</p>
  
  <pre><code>  var searchResults = client.Search&lt;Place&gt;(s =&gt; s
               .From(0)
               .Size(5)
               .Explain(true)
               .TrackScores(true)
               .Query(q =&gt; q
  
                      .QueryString(fqqs1 =&gt; fqqs1
                          .OnFieldsWithBoost(d =&gt; d
                              .Add("name", 5.0)
                          )
                          .Query("west midlands birmingham")
                      )
  
               )
               .Sort(sort =&gt; sort.OnField("_score").Descending())
               .Sort(sort =&gt; sort.OnField(f =&gt; f.id).Ascending())
         );
  
  // Output the results to console
          Console.WriteLine("\nTotal Hits: " + searchResults.HitsMetaData.Hits.Count + " out of " + searchResults.HitsMetaData.Total);
  
          List&lt;Result&gt; results = new List&lt;Result&gt;();
          foreach (Place result in searchResults.Documents)
          {
              results.Add(new Result
              {
                  woeid = Convert.ToInt32(result.id),
                  name = result.name,
                  admin1 = result.admin1,
                  admin2 = result.admin2,
                  type = result.type
              });
              Console.WriteLine(result.id + " &gt; " + result.name + " &gt; " + result.admin1 + " &gt; " + result.admin2 + " &gt; " + result.type); 
          }
  </code></pre>