我尝试使用以下查询,
{
"query":{
"bool":{
"must":[
{
"range":{
"@timestamp":{
"from":"2018-09-01T08:35:11.000Z",
"to":"2018-10-01T08:35:11.000Z"
}
}
},
"multi_match":{
"query":"世界の人々の祝祭、第23回冬季",
"fields":"message"
}
]
}
},
"from":0,
"size":10000
}
但收到错误消息:
{
"error" : {
"root_cause" : [
{
"type" : "json_parse_exception",
"reason" : "Unexpected character (':' (code 58)): was expecting comma to separate Array entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4eacc26c; line: 21, column: 27]"
}
},
"status" : 500
}
但是如果没有时间戳范围,那就可以了
"query": {
"multi_match": {
"query": "世界の人々の祝祭、第23回冬季",
"fields": [
"message"
]
}
}
请求中有什么问题?如何一起执行multi_match和BOOL?
最佳答案
您还需要将multi_match
查询包装在花括号内
{
"query":{
"bool":{
"must":[
{
"range":{
"@timestamp":{
"from":"2018-09-01T08:35:11.000Z",
"to":"2018-10-01T08:35:11.000Z"
}
}
},
{
"multi_match":{
"query":"世界の人々の祝祭、第23回冬季",
"fields":"message"
}
}
]
}
},
"from":0,
"size":10000
}