- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
谁能告诉我为什么下面的映射中的“模式”标记符上不执行“asciifolding”?
我需要使用“模式”标记器,但是我也不需要区分带有重音或没有“asciifolding”功能的重音功能的单词。
我需要“televisão”等于“televisao”,但是“asciifolding”在我的“analyzer_customizado”上不起作用,该“analyzer_customizado”具有“asciifolding”和 token 生成器“pattern”
{
"settings": {
"index": {
"number_of_shards": "5",
"number_of_replicas": "0",
"analysis": {
"filter": {
"stemmer_plural_portugues": {
"name": "minimal_portuguese",
"stopwords" : ["http", "https", "ftp", "www"],
"type": "stemmer"
},
"synonym_filter": {
"type": "synonym",
"lenient": true,
"synonyms_path": "analysis/synonym.txt",
"updateable" : true
},
"shingle_filter": {
"type": "shingle",
"min_shingle_size": 2,
"max_shingle_size": 3
}
},
"analyzer": {
"analyzer_customizado": {
"filter": [
"lowercase",
"stemmer_plural_portugues",
"asciifolding",
"synonym_filter",
"shingle_filter"
],
"tokenizer": "pattern"
}
}
}
}
},
"mappings": {
"properties": {
"id": {
"type": "long"
},
"data": {
"type": "date"
},
"quebrado": {
"type": "byte"
},
"pgrk": {
"type": "integer"
},
"url_length": {
"type": "integer"
},
"titulo": {
"analyzer": "analyzer_customizado",
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"descricao": {
"analyzer": "analyzer_customizado",
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"url": {
"analyzer": "analyzer_customizado",
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
}
}
}
}
有人可以告诉我如何解决我的“asciifolding”映射,以使其在具有标记器“pattern”的“analyzer_customizado”中工作
最佳答案
问题是由于official doc of pattern tokenizer中提到的默认pattern
分析器
The default pattern is \W+, which splits text whenever it encountersnon-word characters.
televisão
为非单词char,因此会为ã
生成两个 token 。
{
"tokenizer": "pattern",
"text": "televisão"
}
{
"tokens": [
{
"token": "televis",
"start_offset": 0,
"end_offset": 7,
"type": "word",
"position": 0
},
{
"token": "o",
"start_offset": 8,
"end_offset": 9,
"type": "word",
"position": 1
}
]
}
解决方案:-不幸的是,没有
ASCIIfolding char filter
可以将其转换为适当的ASCII字符,以防止其在模式标记器中分解为其他标记。您可以引用
this discuss post来进行讨论,并建议使用自定义插件。
关于elasticsearch - 在ElasticSearch中使用 token 化器“asciifolding”的“pattern”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62588187/
我使用 marvel 插件创建了这个测试索引: POST /test { "index" : { "analysis" : { "analyzer" : {
在我的分析器中,我添加了 asciifolding 过滤器。在大多数情况下,这非常有效,但在使用丹麦语时,我不想规范化 øæå 字符,因为“rød”和“rod”是非常不同的词。 我们正在使用托管的弹性
谁能告诉我为什么下面的映射中的“模式”标记符上不执行“asciifolding”? 我需要使用“模式”标记器,但是我也不需要区分带有重音或没有“asciifolding”功能的重音功能的单词。 我需要
将 Elasticsearch JDBC 导入器与此配置一起使用: bin=/usr/share/elasticsearch/elasticsearch-jdbc-2.1.1.2/bin lib=/u
我正在为网页上的所有名称编制索引,其中包含带有“José”等重音符号的字符。我希望能够用“Jose”和“José”搜索这个名字。 我应该如何为只有一个字段“名称”的简单索引设置索引映射和分析器? 我为
我在尝试让“asciifolding”为我的 Rails 应用程序工作时遇到了非常糟糕的时间。我想搜索包含“accented”字符的单词,例如我希望在搜索“foroige”时出现“foróige”。我
我在我的 Rails 4 应用程序中创建了一个搜索引擎,它工作得很好,但我很难让 asciifolding 过滤器工作。我的模型有很多带重音的术语,除非拼写完全正确,否则不会出现,即:我想搜索“Rod
我是一名优秀的程序员,十分优秀!