此搜索以kibana返回正确的文档。
date:"18-01-29" AND time:"00:59:58,809" AND EventType:"ERROR"
如何在elasticsearch中搜索同一文档?
此搜索出错。
curl -XGET 'ip:9200/index_name/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"query_string": {
"query": "(date:18-01-29) AND (EventType:ERROR) AND (time:00\:59\:58,809)"
}
}
}
'
"reason" : "Unrecognized character escape ':' (code 58)\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@3124698d; line: 5, column: 75]"
此搜索不会在elasticsearch中返回正确的文档。
curl -XGET 'ip:9200/index_name/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"bool": {
"must": [
{ "match": { "date": "18-01-29" }},
{ "match": { "time": "00:59:58,809" }},
{ "match": { "EventType": "ERROR" }}
]
}
}
}
'