【发布时间】:2020-06-29 13:05:48
【问题描述】:
-
我正在研究 Elasticsearch 中的全文搜索引擎,并在索引时间内使用多语言数据。我使用弹性搜索进行文本分析,我希望能够在预处理后返回令牌(检索到的索引)。我知道分析 API,但是对 +200.000 个文档执行此操作非常耗时。我找到了“术语聚合”,但我不确定它是如何工作的。有什么想法吗?
-
我在映射语言分析器中使用。使用语言分析器或每个文档都通过每个语言分析器时是否有任何开箱即用的语言检测?如果是这样,使用语言检测并为每种语言创建多字段是否有意义?在设置或映射中使用语言分析器有什么区别?
PUT /index_sample
{
"settings": {
"analysis" : {
"analyzer" : {
"my_analyzer" : {
"type" : "custom",
"tokenizer" : "standard",
"filter" : [
"my_asciifolding",
"my_apostrophe",
"cjk_bigram"]
}
},
"filter" : {
"my_asciifolding" : {
"type" : "asciifolding",
"preserve_original" : true
},
"my_apostrophe" :{
"type" : "apostrophe"
}
}
}
},
"mappings" : {
"properties": {
"category_number" : {
"type" : "integer",
"fields" : {
"raw" : {
"type" : "keyword"
}
}
},
"product": {
"type" : "text",
"index" : "true",
"store" : "true",
"analyzer" : "my_analyzer",
"fields" : {
"german_field": {
"type" : "text",
"analyzer": "german"
},
"english_field" : {
"type" : "text",
"analyzer" : "english"
},
"chinese_field" : {
"type" : "text",
"analyzer" : "smartcn"
},
"spanish_field": {
"type" : "text",
"analyzer" : "spanish"
},
"czech_analyer" : {
"type" : "text",
"analyzer" : "czech"
},
"french_field": {
"type" : "text",
"analyzer" : "french"
},
"italian_field" : {
"type" : "text",
"analyzer" : "italian"
},
"dutch_field": {
"type" : "text",
"analyzer" : "dutch"
},
"portuguese_field": {
"type" : "text",
"analyzer" : "portuguese"
}
}
}
}
}
}
【问题讨论】:
-
为什么要返回文档中的所有标记?你在寻找几个 known_vocabulary_tokens 吗?
-
将令牌存储在数组字段中会让您满意吗?
-
我想看看我的索引字段在文本分析后的样子
标签: elasticsearch nlp