Excluding terms from proximity searches

Post Reply
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

Excluding terms from proximity searches

Post by jkj2001 »

Hi all,

I'm trying to exclude a term from a proximity search and wondered if the thinking below will do the job.

First, a little background: we have some emails in our data, and one of the fields we're interested in is the recipient list. In there we typically have numerous addressees, separated by semi-colons: "james_smith@somewhere.com;james_richards@nowhere.com;susanh@blahblah.org"....

We're looking for all the "james" terms within (for instance) 20 characters of "somewhere". The trouble is, we want to make sure the proximity search doesn't look behind "james" and accidentally pull a user also with somewhere.com. To do this we need to exclude the semi-colon from the proximity search. I think this might do the job, but I'm not sure:

select * from mytable where '+james w/20 somewhere -\;'

Don't know if I need to escape the semi-colon, or if there's another way to go about this?

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

Excluding terms from proximity searches

Post by mark »

Maybe what you really want is
james somewhere w/;

If you want to - the ; you'll need to to escape it as you suggest or do it as a rex
james somewhere -/; w/20
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Excluding terms from proximity searches

Post by John »

It sounds as if what you want is 'james somewhere w/;', that is "james" and "somewhere" using ; as the within delimiter. Not ; would mean that if a semicolon was found within 20 characters it would not be a hit.
John Turnbull
Thunderstone Software
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

Excluding terms from proximity searches

Post by jkj2001 »

thanks guys-- if we go with "w/;", how many characters will be searched between the "james" and "somewhere" before it quits looking for the semicolon? I assume there's a limit?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Excluding terms from proximity searches

Post by mark »

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

Excluding terms from proximity searches

Post by mark »

oops, that should be cap W.

W/[^;]{,20}
Post Reply