dbTalk Databases Forums  

Oracle text : catsearch = 0 behaviour (need to mimic contains = 0)

comp.databases.oracle.server comp.databases.oracle.server


Discuss Oracle text : catsearch = 0 behaviour (need to mimic contains = 0) in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jean-Michel S
 
Posts: n/a

Default Oracle text : catsearch = 0 behaviour (need to mimic contains = 0) - 06-07-2011 , 04:00 AM






Hello,

When i run :

-- operator > 0

select * from mytable where CONTAINS(mycolumn, 'HELLO,WORLD',1) > 0;
select * from mytable where CATSEARCH(mycolumn, 'HELLO | WORLD',NULL)
Quote:
0;
I get all the lines that contain HELLO or WORLD in mycolumn in both
cases. Great.

-- operator = 0

select * from mytable where CONTAINS(mycolumn, 'HELLO,WORLD',1) = 0;
I get all the lines that do not contain HELLO and do not contain
WORLD in mycolumn at the same time.

However when i run this
select * from mytable where CATSEARCH(mycolumn, 'HELLO | WORLD',NULL)
= 0;
I get all the lines that contain HELLO or WORLD in mycolumn, it does
not work like CONTAINS, it works as if we had put >0.

I've read that catsearch does not compute a score so i understand this
behaviour.
But is it still possible to write the query so that the CATSEARCH
operator retrieves lines that do not contain all the words specified ?

We need ctxcat indexes because they are automatically updated after
DMLs and this is not the case with context indexes.

Thank you in advance

Jean-Michel

Reply With Quote
  #2  
Old   
dombrooks
 
Posts: n/a

Default Re: Oracle text : catsearch = 0 behaviour (need to mimic contains = 0) - 06-07-2011 , 07:39 AM






So, could you not rewrite using MINUS or a subquery wiith NOT IN or
NOT EXISTS?
e.g.
select * from mytable where rowid not in (select rowid from mytable
where CATSEARCH(mycolumn, 'HELLO | WORLD',NULL) > 0) ?

Reply With Quote
  #3  
Old   
Jean-Michel S
 
Posts: n/a

Default Re: Oracle text : catsearch = 0 behaviour (need to mimic contains = 0) - 06-07-2011 , 08:33 AM



On Jun 7, 2:39*pm, dombrooks <dombro... (AT) hotmail (DOT) com> wrote:
Quote:
So, could you not rewrite using MINUS or a subquery wiith NOT IN or
NOT EXISTS?
e.g.
select * from mytable where rowid not in (select rowid from mytable
where CATSEARCH(mycolumn, 'HELLO | WORLD',NULL) *> 0) ?
Thank you.
I was looking for a simpler solution, really something like catsearch
= 0.
(because we will use catsearch in complex joins ..)

Reply With Quote
  #4  
Old   
Jean-Michel S
 
Posts: n/a

Default Re: Oracle text : catsearch = 0 behaviour (need to mimic contains = 0) - 06-07-2011 , 09:26 AM



I finally got the solution from the oracle support.
=> transactional parameter

create index myidx on mytable(mycolumn)
indextype is ctxsys.context
parameters ('transactional');

There is also the possibility of SYNC on COMMIT but transactional is
better for our need.

Doc ID 249991.1

Reply With Quote
  #5  
Old   
Jean-Michel S
 
Posts: n/a

Default Re: Oracle text : catsearch = 0 behaviour (need to mimic contains = 0) - 06-07-2011 , 09:28 AM



On Jun 7, 4:26*pm, Jean-Michel S <zejea... (AT) gmail (DOT) com> wrote:
Quote:
I finally got the solution from the oracle support.
=> transactional parameter

create index myidx on mytable(mycolumn)
indextype is ctxsys.context
parameters ('transactional');

There is also the possibility of SYNC on COMMIT but transactional is
better for our need.

Doc ID 249991.1
Thus we can use CONTEXT instead of CTXCAT, i mean.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.