title: What is the SQL “Distinct” equivalent in Kibana?
body: <p>I’m new to Kibana and Elasticsearch.
  I have a field name called <code>serviceprovidername</code>. I would like to find how many distinct service provider name present in this field. How can I achieve this?</p>
  
  <p>This is what I have tried so far.</p>
  
  <blockquote>
    <p>search query</p>
  </blockquote>
  
  <pre><code>GET _search{“ages”: {“distinct_serviceprovidername”:{“terms”:{“field” :”serviceprovidername”}}}}
  </code></pre>
  
  <p>If my raw data is like this</p>
  
  <pre><code> Serviceprovidername 
   _______________________
            X
            Y
            X
            Y
            Y
            Z
  </code></pre>
  
  <p>I’m excepting result as:</p>
  
  <pre><code>    Serviceprovidername 
      _______________________
               X
               Y
               Z
  </code></pre>
  
  <p>Please help</p>