infinilabs/analysis-pinyin

配置"keep_none_chinese_together": "false",ES写入异常

Closed this issue · 2 comments

配置"keep_none_chinese_together": "false",ES写入异常

版本 6.4.0
重现步骤 配置索引mapping
PUT test_index
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"pinyin_analyzer": {
"tokenizer": "my_pinyin"
}
},
"tokenizer": {
"my_pinyin": {
"ignore_pinyin_offset": "false",
"keep_none_chinese_in_first_letter": "true",
"lowercase": "true",
"none_chinese_pinyin_tokenize": "false",
"keep_original": "true",
"keep_none_chinese_together": "false",
"remove_duplicated_term": "false",
"keep_first_letter": "false",
"keep_separate_first_letter": "true",
"type": "pinyin",
"limit_first_letter_length": "16",
"keep_full_pinyin": "false"
}
}
}
}
},
"mappings": {
"_doc": {
"properties": {
"name": {
"analyzer": "pinyin_analyzer",
"term_vector": "with_positions_offsets",
"type": "text"
}
}
}
}
}

POST test_index/_doc
{
"name":"nike鞋子"
}

{
"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=0,endOffset=6,lastStartOffset=4 for field 'name'"
}
],
"type": "illegal_argument_exception",
"reason": "startOffset must be non-negative, and endOffset must be >= startOffset, and offsets must not go backwards startOffset=0,endOffset=6,lastStartOffset=4 for field 'name'"
},
"status": 400
}

medcl commented

fixed with commit, c3f9e96