search in quotes

Post Reply
hqweb0
Posts: 45
Joined: Thu Jun 01, 2006 3:08 am

search in quotes

Post by hqweb0 »

Hi,
what needs to be changed in the script to treat all searches as is they were in quotes?

thanks.
Niamh
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

search in quotes

Post by mark »

Put quotes around the query before submitting it to sql.
hqweb0
Posts: 45
Joined: Thu Jun 01, 2006 3:08 am

search in quotes

Post by hqweb0 »

Sorry, I should have been more specific. without asking the user to place quotes around their query is there anyway for webinator to automatically treat the search query as if it were in quotes.
thanks.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

search in quotes

Post by John »

There isn't an option. You could programatically add the quotes.
John Turnbull
Thunderstone Software
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

search in quotes

Post by mark »

In qpar replace
<$q=$txtquery>
with something like this (untested)
<rex '"' $txtquery>
<if $ret eq ""><!-- no quotes, quote the whole thing -->
<strfmt '"%s"' $txtquery>
<$q=$ret>
<else><!-- has quotes, respect them -->
<$q=$txtquery>
</if>
Post Reply