【发布时间】:2019-04-16 08:29:53
【问题描述】:
我对弹性搜索完全陌生。所以如果这是一个愚蠢的问题,请原谅我,我的问题可能已经在其他地方得到了回答,但我找不到它。 我想在我的网络中使用 Elastic Search 作为 PDF 和 docx 的搜索引擎。我使用 fscrawler 将 PDF 提取到弹性搜索中。由于我要摄取的文档是多种语言的,因此我想使用 n-graming 进行词干提取。为此,我想像这样更新我的映射
PUT test/_mappings/_all
{
"mappings": {
"title": {
"properties": {
"title": {
"type": "text",
"fields": {
"de": {
"type": "string",
"analyzer": "german"
},
"en": {
"type": "string",
"analyzer": "english"
},
"general": {
"type": "string",
"analyzer": "trigrams"
}
}
}
}
}
}
}
现在我收到了这个错误消息
{ “错误”:{ “根本原因”: [ { "type": "mapper_parsing_exception", “原因”:“根映射定义具有不受支持的参数:[映射:{title={properties={title={type=text, 字段={de={type=string,analyzer=german},en={type=string, 分析器=英文},一般={类型=字符串,分析器=trigrams}}}}}}]" } ], "type": "mapper_parsing_exception", “原因”:“根映射定义具有不受支持的参数:[映射:{title={properties={title={type=text, 字段={de={type=string,analyzer=german},en={type=string, 分析器=英文},一般={类型=字符串,分析器=trigrams}}}}}}]"
},“状态”:400 }
你知道我该如何解决这个问题吗?或者您知道如何在不使用 fscrawler 的情况下使用正确的映射来摄取文件?
【问题讨论】:
-
看起来
trigrams不是 ES 中的内置分析器,请按照此 elastic.co/guide/en/elasticsearch/guide/current/… 定义三元组,然后创建映射。 -
我实际上完全按照本指南进行操作
-
你能粘贴
_mappingapi的o/p吗?使用方法请参考elastic.co/guide/en/elasticsearch/reference/current/… -
您认为有比 fscrawler 更好的选择来摄取文档吗?
-
我觉得和
fscrawler没有关系