赞
踩
%title% %cat_name% %desc% %sell_point%------->1、不支持索引 2、多次全表扫描
es是基于lucene的全文检索服务器,对外提供restful接口
正排索引:查字典时从第一页开始找,直到找到为止(正文--->关键字)
倒排索引:查字典时通过目录查找(关键字---->正文)
倒排索引表的组成:
doucument
term------------------->document
term
分词列表的特点:
1、不重复
2、“的 得 地”语气词不参加分词
3、不搜索的field不参加分词
TransportClient:8.0会删除
RESTHighLevelClient:官方推荐
elasticsearch-rest-high-level-client
groupadd elk
usermod -G elk admin
su admin
groups
su root
chown -R admin:elk /usr/upload
chown -R admin:elk /usr/local
cd /usr
ll
su admin
cd /usr/upload
tar -zxvf elasticsearch-6.2.3.tar.gz -C /usr/local
vim /usr/local/elasticsearch-6.2.3/config/elasticsearch.yml
:vim /usr/local/elasticsearch-6.2.3/config/jvm.options
:su root
vim /etc/security/limits.conf
:su root
vim /etc/sysctl.conf
:sysctl -p
cd /usr/local/elasticsearch-6.2.3/bin
启动:
./elasticsearch
或
./elasticsearch -d
PUT /java10
{
"settings":{
"number_of_shards":2, #主分片的数量,提高处理能力
"number_of_replicas":0 #备份分配的数量,提高可用性
}
}
注意:一台服务器时,备份分片的数量必须设置为0
PUT /java10/_settings
{
"number_of_replicas":1
}
注意:index一旦创建,主分片的数量不可修改,因为:hash(id) % number_of_primary_shards=shard
DELETE /java10
POST /java10/course/_mapping
{
"properties":{
"name":{
type:"text"
}
}
}
POST /java10/course/1
{
"name":"python从入门到放弃",
"description":"人生苦短,我用Python",
"studymodel":"201002"
}
PUT /java10/course/1
{
"name":".net从入门到放弃",
"description":".net程序员谁都不服",
"studymodel":"201003"
}
DELETE /java10/course/1
GET /java10/course/1
注意:必须另存为UTF-8格式
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。