Page 1 of 1

multiple proximity search questions

Posted: Thu Mar 24, 2005 11:32 am
by jkj2001
Hi,

We have a client interested in running "creative" proximity searches that use the 'w/' keyword, and weren't sure how best to do it.

The searches they're interested in look something like this in semi-pseudocode:

(myfield like 'Belgium' or myfield like 'Holland') w/200 (myfield like 'Canad* w/25 Mexico')

I may not have described it clearly above, so in english: they want all hits containing 'Belgium' or 'Holland' that are within 200 characters of hits where 'Canad*' is within 25 characters of 'Mexico'. Is this even possible?

multiple proximity search questions

Posted: Thu Mar 24, 2005 11:53 am
by John
We do not currently support nesting proximities. The closest you could get would probably be something like:

myfield like '(belgium,holland) canad* mexico w/225' and myfield like 'Canad* w/25 Mexico'

so belgium or holland within 225 of both canad* and mexico, and canad* and mexico within 25 of each other. That would still allow some hits where the field contains canad* and mexico close together, but not near another occurence of belgium or holland with both canad* and mexico further apart, e.g.

canada mexico {large chunk} canada {100} belgium {100} mexico.

multiple proximity search questions

Posted: Thu Mar 24, 2005 8:31 pm
by jkj2001
Thanks John.

Can I ask another question, a more general one, regarding proximity searching? Suppose I did this:

select * from mytable where myfield like 'Belgium Miami w/15'

I _believe_ this means the word 'Belgium' has to be within 15 characters of 'Miami', but I'm a little hazy on where you start counting the 15 characters from.... is it from the beginning 'M' in Miami, or the last 'i', or either position, whatever it takes to get you within 15 characters is good?

So, would a record containing 'Belgium {7 spaces} Miami' be returned from my search because the capital 'M' is 14 characters from the start of 'Belgium'?

multiple proximity search questions

Posted: Thu Mar 24, 2005 11:48 pm
by John
The way it works is it will find one of the words first, and then look for the other words within N characters of the word. So assuming Belgium is looked for first, then the entire term Miami would need to occur either in the 15 characters preceding the 'B', or in the 15 characters after the 'm' of Belgium.

multiple proximity search questions

Posted: Fri Mar 25, 2005 1:45 pm
by jkj2001
Thanks again, John.