小编Mik*_*ika的帖子

Oracle ctxcat.context包含某些搜索参数的奇怪行为

在Oracle数据库10g和Oracle Database Express Edition 11g中,我遇到了一些奇怪的行为.我有一个索引为ctxsys.context类型索引的列.当我使用contains函数查询表中的结果时,除非我正在搜索的值为"Still",否则它将起作用.然后它不返回任何结果.当我使用像'Still'这样的列搜索相同的数据时,我会正常得到结果.如果我使用contains搜索'Jazz',那么我会正常得到结果.

下面是我用于在新创建的测试表上重现此行为的sql.

-- Setup the table with an index and some data
create table "STILL_TEST" (
    "ID" number(22,0) primary key,
    "PROF_DATA_15" varchar2(255 char),
    "OTHER" varchar2(255 char),
    "SHORTER" varchar2(100 char)
);
insert into "STILL_TEST" values (1, 'Still', 'Still', 'Still');
insert into "STILL_TEST" values (3, 'Jazz', 'Jazz', 'Jazz');
CREATE INDEX "STILL_TEST_PROF_DATA_15" ON "STILL_TEST" ("PROF_DATA_15")
   INDEXTYPE IS "CTXSYS"."CONTEXT" PARAMETERS ('SYNC (ON COMMIT)');
commit;

-- Now query it a bit. See how both types of queries work if the
-- …
Run Code Online (Sandbox Code Playgroud)

database oracle indexing contains

5
推荐指数
1
解决办法
653
查看次数

标签 统计

contains ×1

database ×1

indexing ×1

oracle ×1