我想你可以通过使用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