Home » Server Options » Text & interMedia » Using Near clause for text search (2 Merged) (Oracle 11g in win Xp)
Using Near clause for text search (2 Merged) [message #487556] Tue, 28 December 2010 17:53 Go to next message
rajivn786
Messages: 161
Registered: January 2010
Senior Member
Hi,

I have a requirement to find a text based search. I need to find records where they have a word "negative" or "not" within 5 words of "dialysis"..I am able to find the word "negative" but unable to find "not" as it is a reserved word.

Here are the create table & insert statements..

drop table ab;
create table ab(x varchar2(100));
Insert into ab values ('not on dialysis');
Insert into ab values ('negative not on dialysis');
Insert into ab values ('negative on dialysis');
Insert into ab values ('or dialysis');

create   index a_idx on ab (x) indextype
  is ctxsys.context
  parallel 32;

Select * from ab where instr (lower(x),'dialysis') > 0 
and  (contains(x,'near((dialysis,negative={not}),50)') > 0);


Due to some reason it is unable to find the first record..
The output should be :

'not on dialysis'
'negative not on dialysis'
'negative on dialysis'


Thanks
Re: Near clause text search in Oracle [message #487567 is a reply to message #487556] Tue, 28 December 2010 18:58 Go to previous message
rajivn786
Messages: 161
Registered: January 2010
Senior Member
Hey,

I solved the issue..It's the index that creates an issue for the reserved word..

create   index a_idx on ab (x) indextype
  is ctxsys.context parameters ('stoplist ctxsys.empty_stoplist');


This did give me the desired list.

Thanks
Previous Topic: DRG-50901 error which cannot be reproduced
Next Topic: Privileges to view DR$ tables
Goto Forum:
  


Current Time: Thu Mar 28 07:46:04 CDT 2024