当前位置:网站首页>es索引、类型(mapping)、文档、ik分词器
es索引、类型(mapping)、文档、ik分词器
2022-07-17 10:41:00 【程序三两行】
一、概念
1、初学可以把es看作数据库 可以建立索引(库) 文档(库中的数据)
2、es是面向文档的,一切都是json

3、物理设计
es后台把每个索引划分成多个分片,每份分片可以在集群中的不同服务器间迁移,一个默认就是一个集群 默认集群名称elaticsearch
4、逻辑设计






二、ik分词器
1、概述
把一段中文分成一个个关键字,搜索的时候根据关键信息搜索,会把数据库中或者索引中的数据进行分词,默认中文分词是将每一字都看成一个词,比如我爱中国 分成‘我’ ‘爱’ ‘中’‘国’显然有问题,所以安装中文分词器解决这个问题
ik提供了ik_smart和ik_max_word,其中ik_smart为最少切分,ik_max_word最细粒度划分
2、安装
地址
Releases · medcl/elasticsearch-analysis-ik · GitHub
注意版本和es一致
下载完成解压到es的plugis插件文件下的ik(自己创建)文件夹下,并删除压缩包
查看,进入es bin目录执行
D:\es\elasticsearch-7.14.0\bin>elasticsearch-plugin list "warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME" Future versions of Elasticsearch will require Java 11; your Java version from [D:\Java\jdk1.8.0_131\jre] does not meet this requirement. Consider switching to a distribution of Elasticsearch with a bundled JDK. If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set. ik
3、使用kibana测试
GET _analyze
{
"analyzer": "ik_smart",
"text": "中国共产党"
}
GET _analyze
{
"analyzer": "ik_max_word",
"text": "中国共产党"
}
GET _analyze
{
"analyzer": "ik_max_word",
"text": "java一号中国共产党"
}没有‘java一号’,这种需要自己自定义dic分词
ik目录下配置

再次测试完成
总结:项目中的搜索功能 我们只需定义自己的分词dic文件就行
边栏推荐
- Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found suitable exact version “11.4“)
- npm使用
- MySQL user management
- v-mode
- Part I - Fundamentals of C language_ 5. Arrays and strings
- [C language] user defined type elementary knowledge points
- ES Restful操作
- 【网络研究院】机器学习系统的威胁是时候该认真对待了
- Pytorch calls cublasltmattmul to do GEMM and add bias. It's well written
- 【C语言】指针练习题2——笔试真题及解析
猜你喜欢

面試題-給::memcpy函數設計測試用例

中国十大国民小吃,第一居然是它

Chapter VIII vector of STL

对文本实现分词以及绘制词云

第十章 STL 之 stack

多租户 SaaS 的数据库设计模式,你学废了吗?

AnyControl Demo演示
![[C language] Pointer exercise 2 - real written test questions and analysis](/img/fb/ce6cf718f2ef1a498f82ed29c4e751.png)
[C language] Pointer exercise 2 - real written test questions and analysis

Add - before the command in makefile to ignore the error caused by the command and continue to execute the next command

【洛谷】P2357 守墓人
随机推荐
C语言基础篇 —— 2-3 指针与数组
How to synchronize historical data when MySQL is upgraded to primary and standby?
Fundamentals of C language -- 2-3 pointers and arrays
Google play app store may delete the overview of APP permissions and use a new combination of data security information
Mux256to1v,Hadd,Fadd
程序员成长第二十一篇:做任务分配时,要考虑员工的成长。
Classificateur knn
Chapter IX deque of STL
how to use culasLt
Detailed explanation of C51 common data types
Flink small knowledge -- configuration of task scheduling slots slotsharinggroup
[Network Research Institute] the threat of machine learning system is time to take it seriously
【C语言】指针练习题2——笔试真题及解析
易贝按关键字搜索EBAY商品 API 返回值说明
第4章-一阶多智体系统一致性 -> 领航跟随系统一致性
【洛谷】P2357 守墓人
【C语言】数组知识点总结
R语言data.table导入数据实战:data.table使用dcast.data.table函数实现透视表(pivot table)
如何在监控主机上单独部署agent——WGCLOUD
Chapter 12 list of STL