NLPchina/elasticsearch-sql

需 同时 使用普通属性 和嵌套属性作为查询条件。

linser2015 opened this issue · 1 comments

报错 :all shards failed 。
{
-"_shards": {
"failed": 0,
"successful": 10,
"total": 10
},
-"hits": {
-"hits": [
-{
"_id": "fb4b640a9d02062b-fc6d0118a5bdd868c0fcaffd8e586db8",
"_index": "zipkin:span-2022-11-09",
"_score": 1,
-"_source": {
"duration": 96,
"id": "fb4b640a9d02062b",
-"localEndpoint": {
"ipv4": "192.168.174.1",
"serviceName": "core"
},
"name": "openapi",
-"tags": {
"API_ID": "3256424",
"ERR_CODE": "0",
"URL": "u35652l",
"USER_NAME": "6326e5",
"ap": "s26533sd"
},
"timestamp": 1668005953295178,
"timestamp_millis": 1668005953295,
"traceId": "fb4b640a9d02062b"
},
"_type": "span"
},
-{
"_id": "a347a10dc7aa19f8-befd2d3c2f0477c87d7062a29b587984",
"_index": "zipkin:span-2022-11-09",
"_score": 1,
-"_source": {
"duration": 88,
"id": "a347a10dc7aa19f8",
-"localEndpoint": {
"ipv4": "192.168.174.1",
"serviceName": "core"
},
"name": "openapi",
-"tags": {
"API_ID": "325ere123224",
"ERR_CODE": "0",
"ERR_MSG": "s298d",
"URL": "u35454l",
"USER_NAME": "63455"
},
"timestamp": 1668006245114170,
"timestamp_millis": 1668006245114,
"traceId": "a347a10dc7aa19f8"
},
"_type": "span"
},
-{
"_id": "8ead327a46a91668-6f987ec5aa49b3343624ff6514b21506",
"_index": "zipkin:span-2022-11-09",
"_score": 1,
-"_source": {
"duration": 6020646,
"id": "8ead327a46a91668",
-"localEndpoint": {
"ipv4": "192.168.174.1",
"serviceName": "core"
},
"name": "openapi",
-"tags": {
"API_ID": "323324",
"ERR_CODE": "0",
"URL": "u32l",
"USER_NAME": "32e5",
"ap": "s222sd"
},
"timestamp": 1668003345365969,
"timestamp_millis": 1668003345365,
"traceId": "8ead327a46a91668"
},
"_type": "span"
},
-{
"_id": "9fad0dc2a234fc66-652625642e7d08b8e8baccca02bff5ce",
"_index": "zipkin:span-2022-11-09",
"_score": 1,
-"_source": {
"duration": 83,
"id": "9fad0dc2a234fc66",
-"localEndpoint": {
"ipv4": "192.168.174.1",
"serviceName": "core"
},
"name": "openapi",
-"tags": {
"API_ID": "3256424",
"ERR_CODE": "10",
"URL": "u35652l",
"USER_NAME": "676e5",
"ap": "s265643sd"
},
"timestamp": 1668003573635903,
"timestamp_millis": 1668003573635,
"traceId": "9fad0dc2a234fc66"
},
"_type": "span"
},
-{
"_id": "3",
"_index": "s15",
"_score": 1,
-"_source": {
-"title": [
-{
"input": "blong",
"weight": 20
},
-{
"input": "blockk",
"weight": 30
}
]
},
"_type": "doc"
}
],
"max_score": 1,
"total": 5
},
"timed_out": false,
"took": 4
}

sql是 select * from zipkin:* where name = 'openapi' and timestamp_millis between 1667923228000 and 1668009028000 and nested('tags', tags.ERR_CODE='0')

执行没问题,看看explain行不行
image