I try to get data with curl and I run the query in this way:
curl -XGET '<ip>:9200/info-2019.08.21/_search?pretty' -H 'Content-Type: application/json' -d '
{
"query": {
"bool": {
"must": [
{
"term": {
"name" : "TP-01"
}
},
{
"query_string": {
"default_field": "_all",
"query": "*"
}
}
]
}
}
}'
But I get this response but no data return
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
but I have check the index with the curl command as below,
curl -XGET '<ip>:9200/info-2019.08.21/_search?pretty'
I can get the record as below,
{
"_index" : "info-2019.08.21",
"_type" : "customer",
"_score" : 1.0,
"_source" : {
"name" : "TP-01",
"geoip" : {
"country" : "US",
"city" : "NY",
"long" : 125.683899,
"lat" : 25.1469,
"coordinates" : [
125.683899,
25.1469
]
},
"name" : "TP-01"
}
}
]
}
What I am doing wrong?
-H"name.keyword": "TP-01"