Elasticsearch aggregation don't work
<p>I have a index with visit logs on pages. Each user visit a page is logged with a line : </p>

<pre><code>{
    "_index": "logs",
    "_type": "visit",
    "_id": "AVco3MoAdMBqjXxJcqfF",
    "_version": 1,
    "_score": 1,
    "_source": {
        "@version": "1",
        "@timestamp": "2016-09-14T13:22:20.074Z",
        "user": "309424",
        "page": "15399",
        "countryCode": "FR"
    }
}
</code></pre>

<p>I'm trying to get by countryCode, the most viewed pages</p>

<p>POST request on logs/visit/_search?search_type=count :</p>

<pre><code> {  
    "aggs":{  
        "pages":{  
            "terms":{  
                "field":"page"
            }
        }
    },
    "query":{  
        "bool":{  
            "must":[  
                {  
                    "term":{  
                        "countryCode":{  
                            "value":"FR",
                            "boost":1
                        }
                    }
                }
            ]
        }
    }
}
</code></pre>

<p>But the response array "buckets" is empty. Whereas when I do the query with "user" instead of "countryCode", I get the good result with most viewed pages by the user I specified. But I need it by country.</p>

<p>What's the difference between my countryCode field and my user field ? Both are declared as strings</p>

<pre><code>"countryCode": {
    "type": "string"
},
"user": {
    "type": "string"
}
</code></pre>