我对德国姓氏“Warsoenke”有一种奇怪的行为。
看看这个:
create table test_warsoe
as
select 'Mister Warsoenke ABC-12' name
from dual;
create index test_warsoe_index on test_warsoe(name) indextype is ctxsys.context;
select name,
score(1) as rating_warsoe,
score(2) as rating_warsoen
from test_warsoe
where contains(name,'definescore(Warsoe%,occurrence)',1) > 0
or contains(name,'definescore(Warsoen%,occurrence)',2) > 0;
输出为:
Mister Warsoenke ABC-12 | 2 | 1
我不明白为什么?如果我输入“Warsoe”或“War”,它会返回分数 2。如果我输入“Warsoen”,据我所知,它应该返回 1。
如果我不使用definescore
,它会以相同的方向工作,只是显示不同的数字(27 和 13)。
对于其他姓氏,它工作得完美且清晰。但对于这个...
我猜测这是因为德国数据库设置,例如“War so e...”,但这个想法很奇怪,而且仍然不清楚为什么“Warsoen”会起作用。
有什么想法吗?
编辑
我发现了更多的姓氏,它们的作用并不像上面描述的那样。我仍然没有看到任何可能的解释......
最佳答案
如果有人遇到同样的问题,问题出在 DEFAULT_LEXER 的设置上:
BASE_LETTER | YES
ALTERNATE_SPELLING | GERMAN
这是我们调查后收到的信息:
要更改行为,必须更改两个参数之一,或者必须将附加参数 OVERRIDE_BASE_LETTER 设置为 true(根据 docs )。
关于甲骨文文本 : strange behaviour of score function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21681781/