Single quote in search expression

ethompson
Posts: 6
Joined: Fri Dec 22, 2000 3:03 pm

Single quote in search expression

Post by ethompson »

A lot of the searches on our system are across names. One problem is with names such as L'Anson or O'Brian. If the users searches on "Robert L'Anson" (with the quotes), the results don't contain that string. Yet, if someone searches for a name without any special characters, then it works correctly. What is occuring with the ' character, and how do I work around it? I tried making it into '', but that didn't seem to work.

Thanks,
Erick
User avatar
John
Site Admin
Posts: 2623
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

Single quote in search expression

Post by John »

You probably want to include the single quote in your index expression, which in gw is done with the -k option. e.g. -k"[\alnum']{2,30}"
John Turnbull
Thunderstone Software
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Single quote in search expression

Post by mark »

Also, you'll want to still include the non-' expression, so you'll need 2 -k options. And to reduce index time slightly you might want to use a different ' expression:
-k"[\alnum]{2,30}" -k"\alnum{1,30}>>'=\alnum{1,30}"
And don't forget to -unindex before -index so that the new expressions take.