ES的数据展示
{
-"_shards": {
"failed": 0,
"skipped": 0,
"successful": 1,
"total": 1
},
-"hits": {
-"hits": [
-{
"_id": "RSta6XgBicOjBVdE4bAv",
"_index": "test",
"_score": 1,
-"_source": {
"fileContent": "[[\"1\",\"2\",\"2\"],[\"12\",\"1\",\"2\"],[\"244\",\"1772156@qq.com\",\"null\"],[\"517\",\"504125199503145521\",\"null\"],[\"518\",\"504125ad\",\"null\"],[\"519\",\"500235199804155523\",\"null\"],[\"520\",\"500235199831111111\",\"null\"],[\"521\",\"null\",\"null\"],[\"522\",\"null\",\"null\"],[\"557\",\"null\",\"null\"],[\"558\",\"null\",\"null\"],[\"559\",\"null\",\"null\"],[\"560\",\"null\",\"null\"],[\"561\",\"null\",\"null\"],[\"562\",\"null\",\"null\"],[\"563\",\"null\",\"null\"],[\"564\",\"null\",\"null\"],[\"565\",\"null\",\"null\"],[\"566\",\"null\",\"null\"],[\"567\",\"null\",\"null\"],[\"569\",\"null\",\"null\"],[\"57\",\"null\",\"null\"],[\"571\",\"null\",\"null\"],[\"ff\",\"sadfasfdfdf\",\"12345\"],[\"kk\",\"sadfasfdfdf\",\"12345\"],[\"vvv\",\"sadfasfdfdf\",\"12345\"],[\"wwdd\",\"sadfasfdfdf\",\"12345\"]]",
"id": 19024,
"metadata": "[\"columnName:id,dataType:VARCHAR,comment:\",\"columnName:wf_id,dataType:VARCHAR,comment:\",\"columnName:name,dataType:INT,comment:\"]",
"queryDate": "2021-04-19 17:10:31",
"sql": "select * from student"
},
"_type": "_doc"
},
-{
"_id": "Titl6XgBicOjBVdEY7AJ",
"_index": "test",
"_score": 1,
-"_source": {
"fileContent": "[[\"1\",\"2\",\"2\"],[\"12\",\"1\",\"2\"],[\"244\",\"1772156@qq.com\",\"null\"],[\"517\",\"504125199503145521\",\"null\"],[\"518\",\"504125ad\",\"null\"],[\"519\",\"500235199804155523\",\"null\"],[\"520\",\"500235199831111111\",\"null\"],[\"521\",\"null\",\"null\"],[\"522\",\"null\",\"null\"],[\"557\",\"null\",\"null\"],[\"558\",\"null\",\"null\"],[\"559\",\"null\",\"null\"],[\"560\",\"null\",\"null\"],[\"561\",\"null\",\"null\"],[\"562\",\"null\",\"null\"],[\"563\",\"null\",\"null\"],[\"564\",\"null\",\"null\"],[\"565\",\"null\",\"null\"],[\"566\",\"null\",\"null\"],[\"567\",\"null\",\"null\"],[\"569\",\"null\",\"null\"],[\"57\",\"null\",\"null\"],[\"571\",\"null\",\"null\"],[\"ff\",\"sadfasfdfdf\",\"12345\"],[\"kk\",\"sadfasfdfdf\",\"12345\"],[\"vvv\",\"sadfasfdfdf\",\"12345\"],[\"wwdd\",\"sadfasfdfdf\",\"12345\"]]",
"id": 19025,
"metadata": "[\"columnName:id,dataType:VARCHAR,comment:\",\"columnName:wf_id,dataType:VARCHAR,comment:\",\"columnName:name,dataType:INT,comment:\"]",
"queryDate": "2021-04-19 17:10:57",
"sql": "select * from student"
},
"_type": "_doc"
}
],
"max_score": 1,
-"total": {
"relation": "eq",
"value": 281
}
},
"timed_out": false,
"took": 277
}
原理讲述
以ID作为分片
"_id": "RSta6XgBicOjBVdE4bAv",
"_id": "Titl6XgBicOjBVdEY7AJ",
并发的以分片区域去查询,两个_id就用两个服务去查询,形成分布式查询