| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Mailing Lists -> Oracle-L -> Oracle Text Boolean search
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
-- http://www.freelists.org/webpage/oracle-lReceived on Mon Sep 20 2004 - 20:50:36 CDT
![]() |
![]() |