Some query help!!

Post Reply
skalyanaraman
Posts: 109
Joined: Tue May 29, 2001 9:13 pm

Some query help!!

Post by skalyanaraman »

Hi,
There are a couple of kind of queries which look tough (for me). Could you please help!

1. I am looking to find
a field which has atleast one of ('George','Bush','america') within 50 characters of atleast one of ('Deanna','tea','past','future').
Is the question clear? I want the field to have atleast one word from the first list and the words found should be within 50 characters of atleast one word from the second list.

How do we write a query for this?

thanks!!
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Some query help!!

Post by mark »

('George','Bush','america') ('Deanna','tea','past','future') w/50

you'll also need to have alpopostproc on.
skalyanaraman
Posts: 109
Joined: Tue May 29, 2001 9:13 pm

Some query help!!

Post by skalyanaraman »

Thanks for the help.
Can I ask why I need to have alpostproc on?
also, I am running this query at the tsql prompt. Can i set alpostproc there? I cannot, I think.. also, is it a default when I run at the tsql prompt?

thanks
skalyanaraman
Posts: 109
Joined: Tue May 29, 2001 9:13 pm

Some query help!!

Post by skalyanaraman »

Oh, also one more info.
couple of the terms in the second list are wildcard. I know that wildcard terms inside (,,) for or search won't go well. So, I tried to put a @0 kind of a search. So, is the following possible, and get me what I want?

select DOCID from tbldoc where FIELD1 like 'w/50 ''George Bush America @0'' ''Deanna Tea Past* Future* @0''';

I put the double singlequotes for escaping them.

am I just crazy or is this going to work?

thanks
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Some query help!!

Post by mark »

Sorry, I got carried away with cut-and-paste in #2. It should be
(George,Bush,america) (Deanna,tea,past,future) w/50
The w/ operator requires postprocessing. alpostproc is default on in tsql, default off in vortex.

Intersects (@) apply to all non required and non excluded terms within the query. For that query you could use:
w/50 +(George,Bush,America) Deanna Tea Past* Future* @0
Post Reply