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 ...
随机推荐
- 数组/指针/const/字符串常量的使用传值问题
#include<stdio.h> #include<string.h> int main() { ] = "abcd"; //常指针a指向字符串常量&qu ...
- tfrecord
制作自己的TFRecord数据集,读取,显示及代码详解 http://blog.csdn.net/miaomiaoyuan/article/details/56865361
- 96. Unique Binary Search Trees (Tree; DP)
Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For examp ...
- 🔸RU大神手册上要再“做”的题🔸
- [Selenium] Java代码获取,设置屏幕分辨率
import java.awt.Dimension; import java.awt.DisplayMode; import java.awt.GraphicsDevice; import java. ...
- TabHost tab项单击事件
TabHost 选项发生变化时会触发OnTabChangedListener事件,但是如果当前已经选中第一项,再次单击该项时,OnTabChangedListener不会触发该事件,所以再次单击选中t ...
- [C#] Delegate, Multicase delegate, Event
声明:这篇博客翻译自:https://www.codeproject.com/Articles/1061085/Delegates-Multicast-delegates-and-Events-in- ...
- kaggle-泰坦尼克号Titanic-1
大家都熟悉的『Jack and Rose』的故事,豪华游艇倒了,大家都惊恐逃生,可是救生艇的数量有限,无法人人都有,副船长发话了『lady and kid first!』,所以是否获救其实并非随机,而 ...
- [转]go中的main函数和init函数
Go里面有两个保留的函数:init函数(能够应用于所有的package)和main函数(只能应用于package main).这两个函数在定义时不能有任何的参数和返回值.虽然一个package里面可以 ...
- UVa 11419 SAM I AM (最小覆盖数)
题意:给定一个 n * m 的矩阵,有一些格子有目标,每次可以消灭一行或者一列,问你最少要几次才能完成. 析:把 行看成 X,把列看成是 Y,每个目标都连一条线,那么就是一个二分图的最小覆盖数,这个答 ...