問題現象
キビナでのシミュレーション、インデックスリクエスト
POST /test_ratings/doc/10086
{
"title":"誰も惜しまないし、誰も惜しまない。"
}
エラー
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "startOffset must be non-negative, and endOffset must be >= startOffset, and offsets must not go backwards startOffset=3,endOffset=4,lastStartOffset=4 for field 'title'"
}
],
"type": "illegal_argument_exception",
"reason": "startOffset must be non-negative, and endOffset must be >= startOffset, and offsets must not go backwards startOffset=3,endOffset=4,lastStartOffset=4 for field 'title'"
},
"status": 400
}
これはik_max_word分割が原因です。
{
"tokens" : [
{
"token" : "誰も惜しまないし、誰も惜しまない。",
"start_offset" : 0,
"end_offset" : 7,
"type" : _WORD",
"position" : 0
},
{
"token" : "みんなを助けるんだ。",
"start_offset" : 0,
"end_offset" : 4,
"type" : _WORD",
"position" : 1
},
{
"token" : " ,
"start_offset" : 1,
"end_offset" : 3,
"type" : _WORD",
"position" : 2
},
{
"token" : " ,
"start_offset" : 4,
"end_offset" : 5,
"type" : _CHAR",
"position" : 3
},
{
"token" : " ,
"start_offset" : 3,
"end_offset" : 4,
"type" : _CHAR",
"position" : 4
},
{
"token" : " ,
"start_offset" : 4,
"end_offset" : 5,
"type" : _CHAR",
"position" : 5
},
{
"token" : " ,
"start_offset" : 5,
"end_offset" : 7,
"type" : _WORD",
"position" : 6
}
]
}
ここを見てください、このトークンは2回分離され、start_offsetとend_offsetは2回同じです、これがエラーの主な原因です。
問題の原因
主な問題はAnalyzeContext#outputToResultメソッドにあります。
見えてきたコードの部分は、 このコミットによって投稿されたコードです......。
主にこのサブワードの金李泰契約承認を解決するために、元の結果は金李泰契約承認であり、この結果を追加した後、金李泰契約承認強制的に泰から分離されます。それは良いアイデアです、
For this scenario for 得饶人处且饶人, the output 得饶人處且饶人, 得饶人處,饶人, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and.このandは同じ位置に2回出現し、交差する語彙要素がなく、commintの言うように、交差する語彙要素の前の語彙要素の一語を衝突させて切り取ります。
結論
使用中にこの問題が発生した場合は、ソースコードをダウンロードし、コードのこの部分を削除して再コンパイルし、プラグインをインストールすることで問題を解決できます。
詳しくは、一般公開をご覧ください。