2013-01-18 51 views
2

我正在使用Oracle的文本搜索項目。我在我的專欄中創建了一個ctxsys.context索引,並插入了一個條目「你想要一些酒嗎?」。我執行查詢Oracle Text Search對某些單詞不起作用

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

它給了我沒有結果。查詢'你'和'一些'也會返回零結果。只有'喜歡'和'葡萄酒'符合記錄。甲骨文是否認爲你會停下來?我如何讓Oracle匹配這些單詞?謝謝。

+0

可能重複甲骨文ctxcat.context包含呈現某些搜索參數奇怪的行爲(http://stackoverflow.com/questions/12033722/oracle-ctxcat-context -contains-exhibits-strange-behavior-on-certain-search-param) – Ben

回答

3

所以, 我發現,查詢的輸出是完美的根據停止詞列表那是在oracle中。

那些話可以在CTXSYS包中找到,並且可以查詢使用

SELECT * FROM CTX_STOPLISTS; 
SELECT * FROM ctx_stopwords; 

,是的,甲骨文考慮「你」,「會」在您的查詢的非索引字表和停用詞停止的話。 以下列表是默認停用詞。

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; 

參考link各種功能CTX_DDL包

你可以得到充分DESCRIPT離子有關通過查詢創建的CTX指數,

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

這個答案非常有幫助!非常感謝! – Yangrui

+0

@Yangrui我給你鏈接到Oracle文檔。您可以在官方網站上看到對CTX_DDL的引用。如果你不能在這裏的鏈接。 http://docs.oracle.com/cd/E11882_01/text.112/e24436/cddlpkg.htm#CCREF0600 – knagaev

+0

感謝您的回覆,但我無法看到您提供的鏈接中的停用詞列表,因此最佳答案仍然給出給ajmalmhd04抱歉! – Yangrui

0

看那docs

在第「4.1.5查詢停用詞」,你可以得到一些有用的信息:)

+0

非常感謝! – Yangrui