Hi there,
I have a problem with elastic search when using the json query api
(using terms)
The following query works:
curl -XPOST
'localhost:9200/example-app/car/_search?q=brand:Audi&pretty=true'
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.4054651,
"hits" : [ {
"_index" : "example-app",
"_type" : "car",
"_id" : "220",
"_score" : 1.4054651, "_source" :
{"brand":"Audi","type":"A5","price":60000}
} ]
}
}
This query does not work:
curl -XPOST 'localhost:9200/example-app/car/_search?pretty=true' -d
'
{ "query": { "term" : { "brand" : "Audi" }}}'
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
I am supposing that I simply misunderstood the basic query
capabilities. There are no exceptions in the logs either, so I think
it must be some beginners mistake.
Any help is greatly appreciated!
--Alexander