我认为您可以通过使用word_delimiter 为您的内容编制索引来更改索引过滤器,Compound Word Token Filter
如果使用这个过滤器,
FileV2UpdateRequest会被解析为token:
{
"tokens": [{
"token": "File",
"start_offset": 0,
"end_offset": 4,
"type": "word",
"position": 1
}, {
"token": "V",
"start_offset": 4,
"end_offset": 5,
"type": "word",
"position": 2
}, {
"token": "2",
"start_offset": 5,
"end_offset": 6,
"type": "word",
"position": 3
}, {
"token": "Update",
"start_offset": 6,
"end_offset": 12,
"type": "word",
"position": 4
}, {
"token": "Request",
"start_offset": 12,
"end_offset": 19,
"type": "word",
"position": 5
}]
}
对于搜索内容,您还需要使用 word_delimiter 作为过滤器,而不使用 wild_card。
filev2update 将被分析为令牌:
{
"tokens": [{
"token": "file",
"start_offset": 0,
"end_offset": 4,
"type": "word",
"position": 1
}, {
"token": "V",
"start_offset": 4,
"end_offset": 5,
"type": "word",
"position": 2
}, {
"token": "2",
"start_offset": 5,
"end_offset": 6,
"type": "word",
"position": 3
}, {
"token": "update",
"start_offset": 6,
"end_offset": 12,
"type": "word",
"position": 4
}]
}