HTML Strip Char Filter
The html_strip character filter strips HTML elements from the text and replaces HTML entities with their decoded value (e.g. replacing & with &).
Example outputedit
POST _analyze
{
"tokenizer": "keyword",
![]()
"char_filter": [ "html_strip" ],
"text": "<p>I'm so <b>happy</b>!</p>"
}
|
|
The |
The above example returns the term:
[ \nI'm so happy!\n ]
The same example with the standard tokenizer would return the following terms:
[ I'm, so, happy ]
Configurationedit
The html_strip character filter accepts the following parameter:
|
|
An array of HTML tags which should not be stripped from the original text. |
Example configurationedit
In this example, we configure the html_strip character filter to leave <b> tags in place:
PUT my_index
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "keyword",
"char_filter": ["my_char_filter"]
}
},
"char_filter": {
"my_char_filter": {
"type": "html_strip",
"escaped_tags": ["b"]
}
}
}
}
} POST my_index/_analyze
{
"analyzer": "my_analyzer",
"text": "<p>I'm so <b>happy</b>!</p>"
}
The above example produces the following term:
[ \nI'm so <b>happy</b>!\n ] 源文:https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-htmlstrip-charfilter.html#analysis-htmlstrip-charfilter
HTML Strip Char Filter的更多相关文章
- elasticsearch文档-analysis
elasticsearch文档-analysis analysis 基本概念 全文搜索引擎会用某种算法对要建索引的文档进行分析, 从文档中提取出若干Token(词元), 这些算法称为Tokeniz ...
- ES系列六、ES字段类型及ES内置analyzer分析
一.背景知识 在Es中,字段的类型很关键: 在索引的时候,如果字段第一次出现,会自动识别某个类型,这种规则之前已经讲过了. 那么如果一个字段已经存在了,并且设置为某个类型.再来一条数据,字段的数据不与 ...
- ElasticSearch入门 第七篇:分词
这是ElasticSearch 2.4 版本系列的第七篇: ElasticSearch入门 第一篇:Windows下安装ElasticSearch ElasticSearch入门 第二篇:集群配置 E ...
- ElasticSearch:分析器
ElasticSearch入门 第七篇:分析器 这是ElasticSearch 2.4 版本系列的第七篇: ElasticSearch入门 第一篇:Windows下安装ElasticSearch El ...
- elasticsearch 分析器 分词器
参考:https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-tokenizers.html 在全文搜索(Fu ...
- python 中的高级函数filter()
filter()函数是 Python 内置的另一个有用的高阶函数,filter()函数接收一个函数 f 和一个list,这个函数 f 的作用是对每个元素进行判断,返回 True或 False,filt ...
- python基础——filter函数
python基础——filter函数 Python内建的filter()函数用于过滤序列. 和map()类似,filter()也接收一个函数和一个序列.和map()不同的是,filter()把传入的函 ...
- filter()函数 条件筛选
filter()函数 filter()函数是 Python 内置的另一个有用的高阶函数,filter()函数接收一个函数 f 和一个list,这个函数 f 的作用是对每个元素进行判断,返回 True或 ...
- filter 过滤序列
class filter(object): """ filter(function or None, iterable) --> filter object Ret ...
随机推荐
- 数据库 alert.log 日志中出现 "[Oracle][ODBC SQL Server Wire Protocol driver][SQL Server] 'RECOVER'"报错信息
现象描述: (1).数据库通过调用透明网络实现分布式事务,但透明网关停用后,失败的分布式事务并未清理. (2).数据库 alert 日志 Thu Sep 06 06:53:00 2018 Errors ...
- SpringBoot配置Shiro时@RequiresRoles不起作用
在SpringBoot中配置Shiro,结果@RequiresRoles.@RequiresPermissions等注解都无效 解决方法: 在ShiroConfiguration中注入开启支持aop. ...
- VMTurbo:应对散乱虚拟机的强劲工具
随着服务器虚拟化技术越来越成熟,虚拟机散乱(VM sprawl)和主机资源管理成为了虚拟化数据中心的管理员眼里的两大问题.面对这种情形,一种可行的解决办法就是使用一款名为VMTurbo(vmturbo ...
- Oracle ADF 创建序列
双击VO,打开Attribute 标签页在弹出的窗口中选择Default Value Type 为“Expression”, value 的值为:(new oracle.jbo.server.Sequ ...
- 查询测试程序中的selectOne和selectList函数
selectOne查询一条记录,如果使用selectOne查询多条记录则抛出异常: org.apache.ibatis.exceptions.TooManyResultsException: Expe ...
- Golang之排序算法
冒泡排序 package main //冒泡排序 import "fmt" func bsort(a []int) { ; i < len(a); i++ { ; j < ...
- [转]TCP的拥塞控制
1.引言 计算机网络中的带宽.交换结点中的缓存和处理机等,都是网络的资源.在某段时间,若对网络中某一资源的需求超过了该资源所能提供的可用部分,网络的性能就会变坏.这种情况就叫做拥塞. 拥塞控制就是防止 ...
- redis cluster 使用中出现的问题
问题一 redis.clients.jedis.exceptions.JedisClusterMaxRedirectionsException: Too many Cluster redirectio ...
- Image 和byte[]之间的转换
1.Image 转 byte[] public byte[] GetByteByImage(Image image) { byte[] bt = null; try { if (!image.Equa ...
- Linux文件扩展思考随笔
Linux文件时间 ============================================================ ls -l 文件名 仅看到的是最后被修改的时间 Linux ...