title: Retrieve distinct values for search as you type in Elasticsearch
body: <p>We have a field <code>title</code> and the type is <code>search_as_you_type</code>, </p>
  
  <pre><code>{
    "mappings": {
      "properties": {
        "title": {
          "type": "search_as_you_type"
        }
      }
    }
  }
  </code></pre>
  
  <p>and when we a searching</p>
  
  <pre><code>{
    "query": {
      "match_phrase_prefix": {
        "title": "red"
      }
    }
  }
  </code></pre>
  
  <p>we are getting duplicates results</p>
  
  <pre><code>red car
  red icecream
  red car
  </code></pre>
  
  <p>This is because we have documents with same title values.</p>
  
  <p>Is there a way to indicate that result must have distinct vaules?</p>