{"root_cause"=>[{"type"=>"illegal_argument_exception", "reason"=>"-6ren">
gpt4 book ai didi

elasticsearch - elasticsearch 7.9抛出新错误 “illegal_argument_exception”,因为文本太大

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

升级到ES 7.9后,现在在搜索时出现此错误:

{"error"=>{"root_cause"=>[{"type"=>"illegal_argument_exception", "reason"=>"The length of [data.Basic Information.Doc] field of [59921e665c3e743c5befb1c4] doc of [cases] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting. For large texts, indexing with offsets or term vectors is recommended!"}], "type"=>"search_phase_execution_exception", "reason"=>"all shards failed", "phase"=>"query", "grouped"=>true, "failed_shards"=>[{"shard"=>0, "index"=>"cases", "node"=>"Wrz1BVCJRgOyGOFxC0otMQ", "reason"=>{"type"=>"illegal_argument_exception", "reason"=>"The length of [data.Basic Information.Doc] field of [59921e665c3e743c5befb1c4] doc of [cases] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting. For large texts, indexing with offsets or term vectors is recommended!"}}], "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"The length of [data.Basic Information.Doc] field of [59921e665c3e743c5befb1c4] doc of [cases] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting. For large texts, indexing with offsets or term vectors is recommended!", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"The length of [data.Basic Information.Doc] field of [59921e665c3e743c5befb1c4] doc of [cases] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting. For large texts, indexing with offsets or term vectors is recommended!"}}}, "status"=>400}, @response=#<Net::HTTPBadRequest 400 Bad Request readbody=true>, @headers={"content-type"=>["application/json; charset=UTF-8"], "content-length"=>["1840"]}>
我的理解是,我必须以某种方式设置分析器或索引设置,以使用带有偏移量的term_vectors,但是我不知道该怎么做。
这是我在elastic.yml中更改的东西,还是我启动了curl命令(如果这样,可以帮助curl命令)。
谢谢,
凯文

最佳答案

也许这可以解决问题。

curl -XPUT "localhost:9200/INDEX/_settings" -H 'Content-Type: application/json' -d' {
"index" : {
"highlight.max_analyzed_offset" : 60000000. // Set this value according to your requirement.
}
}
'
还请记住:

Plain highlighting for large texts may require substantial amount of time and memory. To protect against this, the maximum number of text characters that will be analyzed has been limited to 1000000. This default limit can be changed for a particular index with the index setting index.highlight.max_analyzed_offset.


阅读 documentation以了解有关突出显示的信息。

关于elasticsearch - elasticsearch 7.9抛出新错误 “illegal_argument_exception”,因为文本太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63510498/

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