[
https://issues.apache.org/jira/browse/LUCENE-10607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17552124#comment-17552124
]
Dawid Weiss commented on LUCENE-10607:
--------------------------------------
Thank you, ChasenYang (and Google translate...) I think the message is about
integer overflow in the maxArcs computation. Since it's capped by 255, we
should use a long or change the logic so that overflow doesn't occur.
> NRTSuggesterBuilder扩展input
> --------------------------
>
> Key: LUCENE-10607
> URL: https://issues.apache.org/jira/browse/LUCENE-10607
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/FSTs
> Affects Versions: 9.2
> Reporter: ChasenYang
> Priority: Major
>
> suggest模块在创建索引时,调用NRTSuggestBuilder的finishTerm来写入suggest索引。
> 会调用maxNumArcsForDedupByte函数来扩展analyzed,向后扩展3 5 7 .... 255。
> 当entries长度过长(9000000)时,调用maxNumArcsForDedupByte扩展时
>
> private static int maxNumArcsForDedupByte(int currentNumDedupBytes) {
> int maxArcs = 1 + (2 * currentNumDedupBytes);
> if (currentNumDedupBytes > 5) {
> maxArcs *= currentNumDedupBytes;
> //当currentNumDedupBytes大于等于32768时,int相乘会大于int最大值
> }
> return Math.min(maxArcs, 255);
> }
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]