multiple proximity search questions

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

multiple proximity search questions

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

multiple proximity search questions

Post 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.
John Turnbull
Thunderstone Software
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

multiple proximity search questions

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

multiple proximity search questions

Post 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.
John Turnbull
Thunderstone Software
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

multiple proximity search questions

Post by jkj2001 »

Thanks again, John.
Post Reply