elasticsearch analyzer - lowercase and whitespace tokenizer(elasticsearch 分析器 - 小写和空格标记器)
问题描述
如何创建一个映射来标记空格上的字符串并将其更改为小写以进行索引?
How can I create a mapping that will tokenize the string on whitespace and also change it to lowercase for indexing?
这是我当前的映射,它通过空格进行标记,我无法理解如何将其小写并搜索(查询)相同...
This is my current mapping that tokenizes by whitespace by I cant understand how to lowercase it and also search (query) the same...
{
"mappings": {
"my_type" : {
"properties" : {
"title" : { "type" : "string", "analyzer" : "whitespace", "tokenizer": "whitespace", "search_analyzer":"whitespace" }
}
}
}
}
请帮忙...
推荐答案
我设法编写了一个自定义分析器,并且这个工作......
i managed to write a custom analyzer and this works...
"settings":{
"analysis": {
"analyzer": {
"lowercasespaceanalyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase"
]
}
}
}
},
"mappings": {
"my_type" : {
"properties" : {
"title" : { "type" : "string", "analyzer" : "lowercasespaceanalyzer", "tokenizer": "whitespace", "search_analyzer":"whitespace", "filter": [
"lowercase"
] }
}
}
}
这篇关于elasticsearch 分析器 - 小写和空格标记器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:elasticsearch 分析器 - 小写和空格标记器


- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Flexslider 箭头未正确显示 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01