我想你可以通過使用word_delimiter索引您的內容更改索引過濾,Compound Word Token Filter
如果使用這種過濾,
FileV2UpdateRequest將淺析淺析,以代幣:
{
"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 as filter without use 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
}]
}
我確實有一些情況下,我有一個像File_V2_Update一個例子,我想_要在搜索中關係......不會的字分隔符忽略這些? – Nived
它會忽略_,但爲什麼要搜索_? – chengpohi
,因爲如果我有File_V2_Update和FileV2Update,我希望它們可以區分 – Nived