appending quotes around $query

KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

appending quotes around $query

Post by KMandalia »

The best thing to do is to talk for 5-10 minutes. I could give you the URL for searching but if you don't know what are the things we expect our users can search for, it will be waste of your time.

Relevancy not working means that if I do exactly as you said (I had word ordering to max and everything off already which seems logical), I will not see the results I am expecting to see (first 5 results with exact words as the query)

I had the same arguement with my upper management but our end goal is to search only for what the user enters and at the same time have provisions for some industry common words to get excluded,synonyms to be applied (sch. means school etc.). The biggest problem I am having is the publication having different form of words than what people may enter (for example, due to lack of space we only have 'x y z' but people may search for 'xyz' or 'xyz abc' etc.

I am not quite sure how the noise filtering works but if I have a query called "abc" and if I am to match all noise words (ex, 'a' 'the' etc) then sander will take out 'a' from 'abc', right? It shouldn't, but it is doing that in my case (is is because I have linear search on?)

I will give you a call tomorrow. The question here is to tweak some settings. I know all of it may not make sense, but that's what I have to do.
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

appending quotes around $query

Post by KMandalia »

I got a weird problem.

Like google, I am sensing when to make suggestion in the script and as one of the sugegstion I am telling users to put quotes around their terms if they are only interested in exact matches.

I want to show people like (Ex, "your query") but the "your query" part should be a hyperlink that will directly take people to the desired results.

Below is my code:

<if $firsthitno eq 1 and $indexcount gte 20>
<b><font face="arial" size="2" color="#004983"><u>Hint</u>: For Exact Matches Only, Put ' " ' around your Query (Ex, <a href="http://www.creditunions.com/pubs.asp?qu ... $query"</a>)</font></b><br><br>
</if>

%22 is not working but " (quot escape char) is working. However, when I put ", aggreabally, the space within words that got converted to %20 will make the query not work.

How can I make canned searches with ""?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

appending quotes around $query

Post by mark »

KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

appending quotes around $query

Post by KMandalia »

<if $firsthitno eq 1 and $indexcount gte 15 and $done eq 0>
<rex "\space" $query>
<if $ret neq "">
<sum "%s" '"' $query '"'><!-- add quotes -->
<strfmt "%U" $ret><!-- make it URL conformant -->
<b><font face="arial" size="2" color="#004983"><u>Hint</u>: For Exact Matches Only, Put ' " ' around your Query (Ex, <a href="http://www.creditunions.com/pubs.asp?qu ... $query"</a>)</font></b><br><br>
</if>
<$done=1>
</if>

How can I use $done to display the hint on the first page, when no. of results are more than 15 and the hint has not already been shown once?

I am not sure what happens when I compare varibles without first initializing them, do they have "" as value?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

appending quotes around $query

Post by mark »

Variables are "" by default and will compare as 0 if doing a numeric comparison.

Not sure why you need done at all though. The first 2 conditions of your if seem sufficient.
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

appending quotes around $query

Post by KMandalia »

I was trying to display it one time only (even if you hit back button, the hint will not appear)

I was comparing to "", changed to '' and it worked.

Thanks for always helping out on these small (but sometimes frustrating) issues.
Post Reply