Page 1 of 2
appending quotes around $query
Posted: Tue Nov 30, 2004 5:47 pm
by KMandalia
what will be the place where I can append "" surrounding the user's query terms? We need to only search for what the user has entered, nothing else.
is it the same as uncommenting
<apicp exactphrase 1>
(since this one looks a little slower)
appending quotes around $query
Posted: Tue Nov 30, 2004 9:30 pm
by mark
No. You need to put the quotes on
<sum "%s" '"' $query '"'><$query=$ret>
appending quotes around $query
Posted: Wed Dec 01, 2004 9:57 am
by KMandalia
Well, what I really wanted to know is which function will be the best one to put the quotes arround query (init,showform,qpar or fpar)
apperantly, more tweaking will be needed since I am appending quotes to the query in 'init' so the text in the search box changes from 'query' to '"query"' when people hit submit but then when they just from one page to other or hit next button, '"query"' will change to '""query""'
appending quotes around $query
Posted: Wed Dec 01, 2004 11:15 am
by mark
qpar would be the place. In the <else> where mltquery is "". Yeah, you'll only want to add " if there are none already.
appending quotes around $query
Posted: Wed Dec 01, 2004 1:17 pm
by KMandalia
the simplest logic would be to remove all " and then append ".
I am sure I am making a silly mistake here but why the following wouldn't work?
<sandr '"' '' $query>
<sum "%s" '"' $query '"'><$query=$ret>
appending quotes around $query
Posted: Wed Dec 01, 2004 1:25 pm
by KMandalia
never mind.
Insted of putting the first line in qpar, it should be the last line of fpar.
appending quotes around $query
Posted: Wed Dec 01, 2004 3:08 pm
by KMandalia
Big question,
How can apply noise words and synonyms to the query now that I am forcing '"' around the query? The standard is to literally search for whatever is inside the quotes. How to tweak it to look for noise words and synonyms.
Right now I am using sandr that is helping me 90% but I think some sort of rex word matching (not character as sandr does) is required. Can you help me with both synonyms and noise filtering. I already have eqvsusr file and all that.
Just need to search for whatver user entered within quotes but consider noise and synonym
appending quotes around $query
Posted: Wed Dec 01, 2004 3:45 pm
by mark
If you want processing why quote it? Maybe define what you really want for the overall query.
appending quotes around $query
Posted: Wed Dec 01, 2004 4:14 pm
by KMandalia
I don't want to rely on relevance because it is not working.
whatever people enter I want to only search for that, in that particular order only. however, flexibility needs to be provided for people who enter some very common terms that doesn't really exist in the pages I am indexing but is a common standard.
I got the equivalance working so that is not a problem any more.
Again, if some one searches for "term1 term2 noise" I want to only search for pages that have (1) both "term1 term2" and no more involving single one of them and (2) only in the order "term1 term2"
both the objectives are easily achived using '"' but against the standard practice of taking everything within the quote literally, a single processing of noise words needs to be provided.
sandr is working fine for me but it will not work for any word legth 2 or below.
appending quotes around $query
Posted: Wed Dec 01, 2004 5:37 pm
by mark
relevance not working how?
Maybe you want to turn word ordering to max and everything else, except maybe word proximity, to off.
Quoting implies that the user knows exactly what they want. Filtering noise etc implies that they don't know.
Sandr will work with any length so I don't understand your statement about that.