Gossamer Forum
Home : Products : DBMan : Customization :

Problem with WHOLE WORDS setting

Quote Reply
Problem with WHOLE WORDS setting
Code:
I have, or I thought I have, the WHOLE WORDS set on permanently by entering:



<P>
<INPUT TYPE="hidden" NAME="ww" value="on">
<INPUT TYPE="hidden" NAME="sb" VALUE="1">
<INPUT TYPE="hidden" NAME="so" VALUE="ascend">
</p>
Code:
However, when I search for LAST_NAME = 'BUTLER'
and FIRST_NAME = 'R'
I get the following record:
Code:
LAST NAME FIRST NAME DISPLAY NAME
------------ ------------ ----------------
Butler Ellen R. Butler, Ellen R.
I shouldn't get any record, so what have I done wrong?

Thank you.Smile



Quote Reply
Re: Problem with WHOLE WORDS setting In reply to
You haven't done anything wrong. That is exactly how it is supposed to work.

In the text Ellen R., R is a whole word.


JPD
Quote Reply
Re: Problem with WHOLE WORDS setting In reply to
JPD,

I don't know if that explanation will fly. Laugh

I thought it took the whole field value as the "whole" word. Is there a way to make it take the the "whole" field value and evaluate it as "whole" versus parts of a field that are separated by spaces.

Thanks. Smile

Quote Reply
Re: Problem with WHOLE WORDS setting In reply to
Smile That's the only explanation I have!

If you want to match the whole field (and not just a whole word), in sub query, replace

($in{'ww'}) and ($tmpreg = "\\b$tmpreg\\b");

with

($in{'ww'}) and ($tmpreg = "^$tmpreg\$");

(This is from a thread by Eliot. I just thought I'd copy it here. The original thread is at http://www.gossamer-threads.com/...m12/HTML/001157.html.)



JPD
Quote Reply
Re: Problem with WHOLE WORDS setting In reply to
Hi JPD,

Thanks for a response.

I believe I tried this code before when LoisC sent it to me in a different thread. Things were somewhat different then though, so I'll try it a-new.

Thanks. Smile