Page 1 of 1

Excluding terms from proximity searches

Posted: Tue Mar 29, 2005 2:09 pm
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.

Excluding terms from proximity searches

Posted: Tue Mar 29, 2005 2:50 pm
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

Excluding terms from proximity searches

Posted: Tue Mar 29, 2005 2:50 pm
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.

Excluding terms from proximity searches

Posted: Wed Mar 30, 2005 5:59 pm
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?

Excluding terms from proximity searches

Posted: Wed Mar 30, 2005 9:27 pm
by mark
It'll search the entire field.

If you want a limit, code an expression for it.
http://www.thunderstone.com/site/texisman/node109.html

w/[^;]{,20}

Excluding terms from proximity searches

Posted: Thu Mar 31, 2005 10:04 am
by mark
oops, that should be cap W.

W/[^;]{,20}