nested boolean search

Post Reply
gunjan.kapoor
Posts: 4
Joined: Thu Mar 22, 2001 12:35 am

nested boolean search

Post by gunjan.kapoor »

1.
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)

2.
Also, inspite of turning the api for intersects (@) on, the permute operator is not working. What could be the issue?
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

nested boolean search

Post 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.
gunjan.kapoor
Posts: 4
Joined: Thu Mar 22, 2001 12:35 am

nested boolean search

Post by gunjan.kapoor »

Thanks for the quick response.

1.
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.


2.
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?


3.
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?

Gunjan
User avatar
John
Site Admin
Posts: 2580
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

nested boolean search

Post 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.
John Turnbull
Thunderstone Software
james120
Posts: 32
Joined: Tue Aug 31, 2004 7:42 pm

nested boolean search

Post 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).
User avatar
John
Site Admin
Posts: 2580
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

nested boolean search

Post 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.
John Turnbull
Thunderstone Software
Post Reply