How to treat dot character '.' to be a word separator.
(Doc ID 298680.1)
Last updated on APRIL 07, 2022
Applies to:
Oracle Text - Version 9.2.0.5 and laterInformation in this document applies to any platform.
Symptoms
When context searches specify 123 456 it returns all the results whereas if we specify 123.456 it
returns only 123.456. Customer would like to know how can we specify dot as a word separator.And when we search 123.456 it should return all the results.(like 123/456;123.456;123*456;123 456)
Step1
create table TEMP
(
SNO NUMBER(10),
TEST VARCHAR2(10),
PNO NUMBER(10,5)
)
tablespace IS_USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 128K
minextents 1
maxextents unlimited
pctincrease 0
);
Step2
insert into temp values ('1','123.c456c','1');
insert into temp values ('2','123.456d','2');
Step3
CREATE INDEX myindex on temp(test) INDEXTYPE IS ctxsys.context;
Step 4
select * from temp t
where contains(t.test,'123')>0
the above query returns only record 1 and not record 2 (i expect both records
to be returned)
select * from temp t
where contains(t.test,'123 c456c')>0
returns record 1
but
select * from temp t
where contains(t.test,'123 456d')>0
does not return record 2 (i expect this to work)
the only condition to return record to is exact match
select * from temp t
where contains(t.test,'123.456d')>0
Oracle does not seem to convert '.' in record 2 as a word separator and its indexed as a whole.
Is there any setting in oracle to make enable the above condition to work.
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |