I have the following document in Elasticsearch as reported by Kibana:

{"deviceId":"C1976429369BFE063ED8B3409DB7C7E7D87196D9","appId":"DisneyDigitalBooks.PlanesAdventureAlbum","ostype":"iOS"}

Why the following query does not return success?

[root@myvm elasticsearch-1.0.0]# curl -XGET 
'http://localhost:9200/unique_app_install/_search?pretty=1' -d '
{
  "query" : {
    "bool" : {
      "must" : [ {
        "term" : {
          "deviceId" : "C1976429369BFE063ED8B3409DB7C7E7D87196D9"
        }
      }, {
        "term" : {
          "appId" : "DisneyDigitalBooks.PlanesAdventureAlbum"
        }
      }, {
        "term" : {
          "ostype" : "iOS"
        }
      } ]
    }
  }
}'

Here is the response from Elasticsearch:

{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}

As a side question, is this the fastest way to query the data in my case?

Thx in advance.

UPDATE: Could it be related to the fact that I used the following mapping 
for this index?

curl -XPOST localhost:9200/unique_app_install -d '{
    "settings" : {
        "number_of_shards" : 5
    },
    "mappings" : {
        "sdk_sync" : {
            "properties" : {
                "deviceId" : { "type" : "string" , "index": "not_analyzed"},
                "appId" : { "type" : "string" , "index": "not_analyzed"},
                "ostype" : { "type" : "string" , "index": "not_analyzed"}
            }
        }
    }
}'

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/8e0cd982-8597-4b43-ab77-6e9245592ac7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to