elasticsearch TERM query not returning the document that contains the exact term
<p>I have in my documents a state with value "OK".</p>

<p>The following match query returns me this document:</p>

<pre><code>POST /bank/_search
{
    "query": {  
        "bool" : {
        "must" : {
            "match" : { "state" : "OK" }
        } 
}}}
</code></pre>

<p>The following term query does not return me the document with state "OK":</p>

<pre><code>POST /bank/_search
{
    "query": {  
        "bool" : {
        "must" : {
            "term" : { "state" : "OK" }
        } 
}}}
</code></pre>

<p>As per definition "The term query finds documents that contain the exact term specified in the inverted index." Still i am confused why term query does not return the desired document.</p>

<p>I imported the data through sense by executing following command:</p>

<pre><code>curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary "@accounts.json"
curl 'localhost:9200/_cat/indices?v'
</code></pre>

<p>It would be great if someone can also share some info about inverted/non-inverted, analyzed/non-analyzed and term/match. I read about these but i am still confused.</p>