ElasticSearch 笔记
2020-10-30 本文已影响0人
三分归元币
简单搭建
使用docker pull 一个elastic search 本地启动kibana 配置服务地址


基本命令
安装分词器
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.5.4/elasticsearch-analysis-ik-6.5.4.zip
kibana创建一个索引
PUT /city
{
"settings":{
"index":{
"number_of_shards":3,
"number_of_replicas":0
}
},
"city_name":{
"article":{
"properties":{
"id":{
"type":"long"
},
"name":{
"type":"text",
"analyzer": "ik_max_word"
}
}
}
}
}
为索引添加一条数据
POST /city/city_name/_search
{
"id":1,
"name":"杭州"
}
查询索引数据
POST /city/_search
{
"query": { "match": { "name": "苏州" } }
}
获取索引结构
GET city/_mappings