一.安装
二.启动
http://192.168.35.111:9200/
{
"name" : "es-node1",
"cluster_name" : "imooc-elasticsearch1",
"cluster_uuid" : "61a719AaQaSXVe1WvYRr9Q",
"version" : {
"number" : "7.4.2",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "2f90bbf7b93631e52bafb59b3b049cb44ec25e96",
"build_date" : "2019-10-28T20:40:44.881551Z",
"build_snapshot" : false,
"lucene_version" : "8.2.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
三.安装可视化工具 es-head(谷歌插件)
下载插件:https://github.com/liufengji/es-head
创建索引(相当于表格,分了5个片区,灰色表示副本没有被分配)
四.常用字段
"explain":true:开启打分机制
POST zhsxf/client/_search
{
"from":0,"size":1,
"query":{"term":
{"serialNumber":{"value":"02500000000005",
"boost":1.0}
}
},
"explain":true
}
{
"took": 2, 花费时间毫秒
"timed_out": false,是否超时
"_shards": {
"total": 12,
"successful": 12,
"skipped": 0,
"
from sort
searchSourceBuilder.query(qb).sort("currentTime", sortOrder).from((param.getPage() - 1) * param.getSize()).size(param.getSize());