@nalan90
2019-09-21T17:59:26.000000Z
字数 4281
阅读 1064
ELK学习
简介
说明: Elasticsearch is the distributed search and analytics engine at the heart of the Elastic Stack. Elasticsearch provides real-time search and analytics for all types of data.
基础概念
抽象与类比
数据类型
mapping & setting
PUT /employees/
{
"mappings" : {
"properties" : {
"age" : {
"type" : "integer"
},
"gender" : {
"type" : "keyword"
},
"job" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 50
}
}
},
"name" : {
"type" : "keyword"
},
"salary" : {
"type" : "integer"
}
}
}
}
GET employees
{
"employees" : {
"aliases" : { },
"mappings" : {
"properties" : {
"age" : {
"type" : "integer"
},
"gender" : {
"type" : "keyword"
},
"job" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 50
}
}
},
"name" : {
"type" : "keyword"
},
"salary" : {
"type" : "integer"
}
}
},
"settings" : {
"index" : {
"creation_date" : "1569033870664",
"number_of_shards" : "1",
"number_of_replicas" : "1",
"uuid" : "ibWvaiBKQcOn2ve-gszKAg",
"version" : {
"created" : "7010099"
},
"provided_name" : "employees"
}
}
}
}
倒排索引
分词器
github: https://github.com/KennFalcon/elasticsearch-analysis-hanlp
[es@dmp-datanode02 ~]$ cd elasticsearch-7.1.0
[es@dmp-datanode02 elasticsearch-7.1.0]$ pwd
/home/es/elasticsearch-7.1.0
[es@dmp-datanode02 elasticsearch-7.1.0]$ ./bin/elasticsearch-plugin list
## 安装指定版本的分词器
[es@dmp-datanode02 elasticsearch-7.1.0]$ ./bin/elasticsearch-plugin install https://github.com/KennFalcon/elasticsearch-analysis-hanlp/releases/download/v7.1.0/elasticsearch-analysis-hanlp-7.1.0.zip
[es@dmp-datanode02 elasticsearch-7.1.0]$ ./bin/elasticsearch-plugin list
analysis-hanlp
常用操作CURD
基于词项与基于全文的搜索
结构化搜索
聚合搜索
接口类型
网红campaign广场
总结