title: When I add Sort() in elasticsearch (NEST) I don't get any hits
body: <p>When I sort like this:</p>
  
  <pre><code>.Sort(sortDescriptor =&gt; sortDescriptor.Descending(product =&gt; product.TopProduct))
  </code></pre>
  
  <p>I have no hits. Any idea why? Is the syntax wrong or what? I got this from the official NEST/elasticsearch docs site.</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>I had to add <code>.Suffix("keyword")</code> like this:</p>
  
  <pre><code>.Sort(sortDescriptor =&gt; sortDescriptor.Descending(product =&gt; product.TopProduct.Suffix("keyword")))
  </code></pre>
  
  <p>And it worked. I had to use the "keyword" subfield on "TopProduct".</p>
  
  <blockquote>
    <p><strong>Default mapping for String propertiesedit:</strong> 
    When using Auto Mapping, the inferred mapping for a string POCO type is a text datatype with
    multi fields including a keyword sub field</p>
  </blockquote>
  
  <p>Source: <a href="https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/multi-fields.html#_default_mapping_for_string_properties" rel="noreferrer">https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/multi-fields.html#_default_mapping_for_string_properties</a></p>
  
  <blockquote>
    <p>If you index a string with no mapping, ES in 5.0+ now automatically
    creates a text version and a keyword version (under .keyword) of the
    field. - dakroneLee HinmanElastic Team Member</p>
  </blockquote>
  
  <p>Source: <a href="https://discuss.elastic.co/t/is-sorting-on-text-string-field-no-longer-available-in-5-x/68586/4" rel="noreferrer">https://discuss.elastic.co/t/is-sorting-on-text-string-field-no-longer-available-in-5-x/68586/4</a></p>
  
  <p>This worked but could someone explain to me how the text and keyword datatypes work?</p>