Page 1 of 1

nested boolean search

Posted: Thu Mar 29, 2001 1:34 am
by gunjan.kapoor
How can I phrase a query of this form with webinator :
((a AND b) OR i) OR (c AND d AND e) OR (f OR g OR h)

Also, inspite of turning the api for intersects (@) on, the permute operator is not working. What could be the issue?

nested boolean search

Posted: Thu Mar 29, 2001 6:31 am
by bart
1: Nested logic has to be performed at the SQL level. Non-nested queries can look like this:
(a,b,c) (d,e,f) -(g,h) which is the same as the boolean ((a or b or c) and (d or e or f) and not (g or h)).

2: Just making sure: Are you using LIKE instead of LIKEP as well? did you issue the <apicp alintersects 1> just before the <sql> query? If so, then a query like "(a,b,c) (d,e,f) (g,h,i) @1" should function.

nested boolean search

Posted: Thu Mar 29, 2001 8:22 am
by gunjan.kapoor
Thanks for the quick response.

So you are saying that queries like :
(a and b) or (c and d) or (e and f)
are possible. Could you give the search syntax for this query as well.

You mention that for nested queries, the logic will have to be taken care of at the SQL level, could you give an example for the same?

The <apicp alintersects 1> has been issued before the <sql> query. However, it is not working.
Your comment on LIKE Vs LIKEP is a little unclear. What should I be using - LIKE or LIKEP?


nested boolean search

Posted: Thu Mar 29, 2001 5:24 pm
by John
With SQL syntax you can say:

WHERE field LIKE 'a b' OR field LIKE 'c d' OR field LIKE 'e f'

This is not really the sort of query that is typically done for text searching. Usually you are looking for a number of different concepts occurring together, each of which may be described by one of several words:

WHERE field LIKE '(a,b) (c,d) (e,f)';

which is (a OR b) AND (c OR d) AND (e OR f);

If you want the fine level of control you should use LIKE. LIKEP ranks, and will find matches which do not contain all the results, and generally ignores the permute operator.

Also make sure you have the right number after the @ sign. @0 indicates any one of the sets.

nested boolean search

Posted: Mon Sep 20, 2004 12:54 am
by james120
Can you expand a bit on what is possible and what is not possible with LIKEP and nested booelan logic? For my application, people are used to using complex boolean queries, so I would like to allow that, but it seems like you might be saying that it is not possible. What about using a + or - in front of every word. That would stop LIKEP from returning matches that do not contain all results, wouldn't it? (Unless a term is included with "OR", in which case that's fine).

nested boolean search

Posted: Mon Sep 20, 2004 10:40 am
by John
LIKEP will return results that have all terms marked with a + and none marked with a -. The message above explains what can be done with a single LIKEP query, and you can use SQL boolean logic to handle other cases.