elasticsearch 分析器阅读笔记(五)
倒排索引
可以查看这里得分词原理https://www.cnblogs.com/LQBlog/articles/5743991.html
分析器
分析器处理过程的3步骤
1.字符过滤器:去除字符的特殊字符
2.分词器:将词组分词
3.对分词词组进行操作,比如转大写 分词后的词组替换等
ES内置的几种分析器结果
例句:Set the shape to semi-transparent by calling set_trans(5)
标准分析器
适合英文 es默认的分词器
根据单词边界分词 然后去掉特殊符号 最后转小写
分词后结果
set, the, shape, to, semi, transparent, by, calling, set_trans, 5
简单分析器
根据单词边界分词 非单词切割
分词后结果
set, the, shape, to, semi, transparent, by, calling, set, trans
语言分析器
特定语言分析器。自带一套字库
测试分析器
get请求:http://127.0.0.1:9200/_analyze
body:
{
"analyzer":"standard",//分词器
"text":"Set the shape to semi-transparent by calling set_trans(5)"//测试分词的fulltext
}
结果:
{
"tokens": [
{
"token": "set",//被索引的词
"start_offset": 0,//原文本起始位置
"end_offset": 3,//原文本结束位置
"type": "<ALPHANUM>",
"position": 0//第几个出现
},
{
"token": "the",
"start_offset": 4,
"end_offset": 7,
"type": "<ALPHANUM>",
"position": 1
},
{
"token": "shape",
"start_offset": 8,
"end_offset": 13,
"type": "<ALPHANUM>",
"position": 2
},
{
"token": "to",
"start_offset": 14,
"end_offset": 16,
"type": "<ALPHANUM>",
"position": 3
},
{
"token": "semi",
"start_offset": 17,
"end_offset": 21,
"type": "<ALPHANUM>",
"position": 4
},
{
"token": "transparent",
"start_offset": 22,
"end_offset": 33,
"type": "<ALPHANUM>",
"position": 5
},
{
"token": "by",
"start_offset": 34,
"end_offset": 36,
"type": "<ALPHANUM>",
"position": 6
},
{
"token": "calling",
"start_offset": 37,
"end_offset": 44,
"type": "<ALPHANUM>",
"position": 7
},
{
"token": "set_trans",
"start_offset": 45,
"end_offset": 54,
"type": "<ALPHANUM>",
"position": 8
},
{
"token": "5",
"start_offset": 55,
"end_offset": 56,
"type": "<NUM>",
"position": 9
}
]
}
查询某个文档的分词结果
GET /${index}/${type}/${id}/_termvectors?fields=${fields_name}
elasticsearch 分析器阅读笔记(五)的更多相关文章
- SOA 面向服务架构 阅读笔记(五)
14 SOA 服务管理器 契约:契约中必须明确定义双方的责任,否则就会产生混乱. SOA可以管理端到端的流程. IT技术一直是与业务对齐的. 14.1.1 分解IT层 业务服务层 管道层 硬件层 管道 ...
- 论文阅读笔记五十六:(ExtremeNet)Bottom-up Object Detection by Grouping Extreme and Center Points(CVPR2019)
论文原址:https://arxiv.org/abs/1901.08043 github: https://github.com/xingyizhou/ExtremeNet 摘要 本文利用一个关键点检 ...
- elasticsearch 分布式阅读笔记(二)
说明 扩展分为 纵向扩展:购买更好的服务器 横向扩展:增加服务器(elasticsearch更适合横向扩展) elasticsearch可以用于构建高可用和可扩展的系统,elasticsearch天生 ...
- 论文阅读笔记五十七:FCOS: Fully Convolutional One-Stage Object Detection(CVPR2019)
论文原址:https://arxiv.org/abs/1904.01355 github: tinyurl.com/FCOSv1 摘要 本文提出了一个基于全卷积的单阶段检测网络,类似于语义分割,针对每 ...
- HTTP权威指南阅读笔记五:Web服务器
Web服务器会做些什么: 1.建产连接:接受一个客户端连接,或者如果不希望与这个客户端建立连接,就将其关闭. 1)处理新连接 2)客户端主机名识别 3)通过ident确定客户端用户 ident在组织内 ...
- Regex阅读笔记(五)java操作篇
首先一个demo程序 Java的正则表达式包为java.util.regex,主要是使用其中的Pattern和Matcher. groupCount方法时候都可调用,而大多数方法都必须在匹配尝试成功之 ...
- 论文阅读笔记五十五:DenseBox: Unifying Landmark Localization with End to End Object Detection(CVPR2015)
论文原址:https://arxiv.org/abs/1509.04874 github:https://github.com/CaptainEven/DenseBox 摘要 本文先提出了一个问题:如 ...
- 论文阅读笔记五十四:Gradient Harmonized Single-stage Detector(CVPR2019)
论文原址:https://arxiv.org/pdf/1811.05181.pdf github:https://github.com/libuyu/GHM_Detection 摘要 尽管单阶段的检测 ...
- 论文阅读笔记五十三:Libra R-CNN: Towards Balanced Learning for Object Detection(CVPR2019)
论文原址:https://arxiv.org/pdf/1904.02701.pdf github:https://github.com/OceanPang/Libra_R-CNN 摘要 相比模型的结构 ...
随机推荐
- C++组合通信
#include <iostream> #include<vector> #include<string> using namespace std; class A ...
- Windows 驱动开发 - 8
最后的一点开发工作:跟踪驱动. 一.驱动跟踪 1. 包括TMH头文件 #include "step5.tmh" 2. 初始化跟踪 在DriverEntry中初始化. WPP_INI ...
- Android Calendar的运用
import java.text.DateFormat; import java.text.ParsePosition; import java.text.SimpleDateFormat; impo ...
- 98.Ext.form.Label组件的基本用法
转自:https://www.cnblogs.com/kelly/archive/2009/06/05/1496897.html 本篇介绍Ext.form.Label组件的基本用法: 这里通过上一篇介 ...
- springCloud多模块打包时报错问题
执行mvn clean package spring-boot:repackage,报错如下: [ERROR] Failed to execute goal org.springframework.b ...
- SpringBoot + MyBatis(注解版),常用的SQL方法
一.新建项目及配置 1.1 新建一个SpringBoot项目,并在pom.xml下加入以下代码 <dependency> <groupId>org.mybatis.spring ...
- Windows 环境下 Docker 使用及配置
原文引用: https://www.cnblogs.com/moashen/p/8067612.html 我们可以使用以下两种方式在Windows环境下使用docker: 1. 直接安装: Docke ...
- 5.29clone项目地址
- JavaScript(基于react+dva)
变量声明 const 和 let:分别表示常量和变量 模板字符串 const user = 'world'; console.log(`hello ${user}`); // hello world ...
- Android 概览屏幕
文章照搬过来的:原文地址https://developer.android.google.cn/guide/components/recents.html 概览屏幕(也称为最新动态屏幕.最近任务列表或 ...