title: Elasticsearch find ONLY perfect match
body: <p>I've been trying to do this for some time, read and searched a lot and I haven't found any definitive answer or solution.</p>
  
  <p>Let's say we add some documents:</p>
  
  <pre><code>$ curl -XPUT http://localhost:9200/tm/entries/1 -d '{"item": "foo" }'
  {"_index":"tm","_type":"entries","_id":"1","_version":1,"created":true}
  
  $ curl -XPUT http://localhost:9200/tm/entries/2 -d '{"item": "foo bar" }'
  {"_index":"tm","_type":"entries","_id":"2","_version":1,"created":true}
  
  $ curl -XPUT http://localhost:9200/tm/entries/3 -d '{"item": "foo bar foo" }'
  {"_index":"tm","_type":"entries","_id":"3","_version":1,"created":true}
  </code></pre>
  
  <p>After this, i want to find ONLY the document(s) that match perfectly the search query</p>
  
  <pre><code>$ curl -XGET http://localhost:9200/_search?q=foo
  </code></pre>
  
  <p>The result contains all 3 documents and I only want to get the one which matches "foo" only and nothing else.</p>
  
  <p>Also,</p>
  
  <pre><code>$ curl -XGET http://localhost:9200/_search?q=bar foo
  </code></pre>
  
  <p>Should not return any results.</p>
  
  <ol>
  <li>Can Elasticsearch do that?</li>
  <li>How? </li>
  </ol>
  
  <p>Update: 
  Existing mapping:</p>
  
  <pre><code>{
      "tm": {
          "mappings": {
              "entries": {
                  "properties": {
                      "item": {
                          "type": "string"
                      }
                  }
              }
          }
      }
  }
  </code></pre>