我正在使用邮递员,并试图搜索查询加上使用范围日期,但我得到一个错误,它的格式查询,您能帮助我。
错误:
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 8,
"col": 5
}
],
"type": "parsing_exception",
"reason": "[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 8,
"col": 5
},
"status": 400
}
正文查询:
{ "query": {
"match": {
"category": {
"query": "الأنظمة",
"operator": "and"
}
},
"range": {
"date": {
"gte": "1970-01-01",
"lt": "2400-01-01"
}
}
},
"size":"1000",
"sort": [
{"date": "desc"}
]
}
发布于 2021-09-22 02:41:43
您的查询格式不正确,需要使用bool/filter/must
queries组合约束
这将会起作用:
{
"query": {
"bool": {
"must": [
{
"match": {
"category": {
"query": "الأنظمة",
"operator": "and"
}
}
}
],
"filter": [
{
"range": {
"date": {
"gte": "1970-01-01",
"lt": "2400-01-01"
}
}
}
]
}
},
"size": "1000",
"sort": [
{
"date": "desc"
}
]
}
https://stackoverflow.com/questions/69282137
复制相似问题