【问题标题】:Oracle Text Search doesn't work on some wordsOracle 文本搜索不适用于某些单词
【发布时间】:2013-01-01 16:30:09
【问题描述】:

我正在为我的项目使用 Oracle 的文本搜索。我在我的专栏上创建了一个 ctxsys.context 索引并插入了一个条目“你想要一些酒吗???”。我执行了查询

select guid, text, score(10) from triplet where contains (text, 'Would', 10) > 0

它没有给我任何结果。查询“you”和“some”也返回零结果。只有 'like' 和 'wine' 匹配记录。甲骨文是否将您视为停用词?我怎样才能让Oracle匹配这些词?谢谢。

【问题讨论】:

标签: oracle full-text-search


【解决方案1】:

docs

在“4.1.5 查询停用词”段落中,您可以获得一些有用的信息:)

【讨论】:

    【解决方案2】:

    所以, 根据 oracle 中的停用词列表,我发现查询的输出是完美的。

    这些词可以在 ctxsys 包中找到,您可以使用

    查询停止列表和停止词
    SELECT * FROM CTX_STOPLISTS;
    SELECT * FROM ctx_stopwords;
    

    是的,oracle 将查询中的“you”、“would”视为停用词。 以下列表是默认停用词。

    a   did     in  only    then    where
    all     do  into    onto    there   whether
    almost  does    is  or  therefore   which
    also    either  it  our     these   while
    although    for     its     ours    they    who
    an  from    just    s   this    whose
    and     had     ll  shall   those   why
    any     has     me  she     though  will
    are     have    might   should  through     with
    as  having  Mr  since   thus    would
    at  he  Mrs     so  to  yet
    be  her     Ms  some    too     you
    because     here    my  still   until   your
    been    hers    no  such    ve  yours
    both    him     non     t   very     
    but     his     nor     than    was      
    by  how     not     that    we   
    can     however     of  the     were     
    could   i   on  their   what     
    d   if  one     them    when     
    

    如果您需要删除一些指定的词(或添加停用词),

    (您需要 **GRANT EXECUTE ON CTXSYS.CTX_DDL 给您**) 然后,你必须执行一个程序, 示例:

    begin
    ctx_ddl.remove_stopword('mystop_list','some');
    ctx_ddl.remove_stopword('mystop_list','you');
    end;
    

    ctx_ddl包中的各种功能请参考link

    您可以通过查询获得有关创建的 ctx 索引的完整描述,

    select ctx_report.describe_index('yourindex_name') from dual;
    

    【讨论】:

    • 这个答案很有帮助!!非常感谢!
    • @Yangrui 我给了你 Oracle 文档的链接。您可以在官方站点中看到对 CTX_DDL 的引用。如果你不能在这里是链接。 docs.oracle.com/cd/E11882_01/text.112/e24436/…
    • 感谢您的回复,但是我无法从您提供的链接中看到停用词列表,所以最好的答案仍然给 ajmalmhd04 抱歉!
    猜你喜欢
    • 1970-01-01
    • 2012-10-05
    • 2016-08-13
    • 2015-07-10
    • 1970-01-01
    • 2020-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多