【发布时间】:2015-11-17 15:00:26
【问题描述】:
索引我的数据时出现此错误。经过一番研究,我发现为什么会发生这种情况,并且增加了max_token_length 所以我这样做了,但我仍然收到与TokenStream expanded to 912 finite strings. Only <= 256 finite strings are supported 相同的错误
这是我的分析仪设置:
"settings": {
"index": {
"analysis": {
"analyzer": {
"shingle_analyzer": {
"tokenizer": "standard",
"max_token_length": 920,
"filter": ["lowercase", "shingle_filter", "asciifolding"],
"char_filter": ["html_strip"],
"type": "custom"
},
"html_analyzer": {
"tokenizer": "standard",
"max_token_length": 920,
"filter": ["lowercase", "asciifolding"],
"char_filter": ["html_strip"],
"type": "custom"
}
},
"tokenizer": {
"standard": {
"type": "standard"
}
},
"filter": {
"shingle_filter": {
"min_shingle_size": 2,
"max_shingle_size": 5,
"type": "shingle"
}
}
}
}
}
这是我尝试插入的示例:
POST /my_index/my_type/{id}
{
"myField":{
"input":"Abcdefghij kl Mnopqrstwx yz Abcdef g Hijklmno pq Rstwxy Zabc (DEF)",
"weight":2,
"payload":{
"iD":"2786129"
}
}
}
这是my_type 属性的映射
"Suggestion": {
"properties": {
"id": {
"index": "not_analyzed",
"type": "integer"
},
"myField": {
"type": "completion",
"analyzer": "shingle_analyzer",
"search_analyzer": "shingle_analyzer",
"max_input_length": 150,
"payloads": true
}
}
}
我错过了什么?
我将不胜感激任何帮助或解决此问题的线索,谢谢!
编辑:
已更正 analyzer 封闭丢失
【问题讨论】:
-
请注意,您在索引设置中缺少并包含
"analyzer": {...}部分以包装您的自定义分析器。请参阅 structure of custom analyzers、analyzer、tokenizer和filter都在analysis结构中。 -
哦,对不起,我只是写错了,我实际上把它们都包含在
analyzer设置中
标签: elasticsearch