title: Compare documents in Elasticsearch
body: <p>I am new to Elasticsearch and I am trying to get all documents which have same mobile type. I couldn't find a relevant question and am currently stuck.</p>
  
  <pre><code>curl -XPUT 'http://localhost:9200/sessions/session/1' \
       -d '{"useragent": "1121212","mobile": "android", "browser": "mozilla", "device": "computer", "service-code": "1112"}'
  </code></pre>
  
  <p>EDIT - </p>
  
  <p>I need <code>Elasticsearch</code> equivalent of following -</p>
  
  <pre><code>SELECT * FROM session s1, session s2 
  where s1.device == s2.device
  </code></pre>