Oracle Text Boolean search

  • From: geraldine_2@xxxxxxxxxxx
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Tue, 21 Sep 2004 01:55:00 +0000

hi, can someone provide some insights how I can rewrite my boolean search query 
more efficiently? 

I would like to do a search for something like "(a AND b) or (c AND d) or (e 
AND f)..."

The query I have  formulated does not scale well when I have multiple AND's and 
OR's.  

 select * from (
     (   select id, name from testtable tab1
         where tab1.type='HEADING'
         and contains (value, 'a')>1
         AND EXISTS
         (select id, name from testtable tab2
          where tab1.id=tab2.id
           and tab2.type='BODY'
           and  contains (value, 'b')>1
         )
     )
     UNION
     (   select id, name from testtable tab1
         where tab1.type='BODY'
         and contains (value, 'c')>1
         AND EXISTS
         (select id, name from testtable tab2
          where tab1.id=tab2.id
           and tab2.type='SUBHEADING'
           and  contains (value, 'd')>1
         )
     )
      UNION
       ...
       ...
        and so on....


appreciate any help.

thanks.

geraldine
--
//www.freelists.org/webpage/oracle-l

Other related posts: