gpt4 book ai didi

elasticsearch - IllegalArgumentException-仅支持<= 256个有限字符串

转载 作者:行者123 更新时间:2023-12-02 22:40:16 26 4
gpt4 key购买 nike

索引数据时出现此错误。经过一些研究,我发现了为什么会这样,并增加了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的问题

最佳答案

好吧,几天前,我想到了一个解决方案。我只是从分析器中的设置中删除了max_token_length属性,并从字段中的映射中减少了max_input_length,这似乎解决了我的问题,但是老实说,我不确定为什么会这样以及为什么会解决它。如果有人有想法,请随时分享您的知识:)

关于elasticsearch - IllegalArgumentException-仅支持<= 256个有限字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33760152/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com