appending quotes around $query

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

appending quotes around $query

Post 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)
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

appending quotes around $query

Post by mark »

No. You need to put the quotes on
<sum "%s" '"' $query '"'><$query=$ret>
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

appending quotes around $query

Post 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""'
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

appending quotes around $query

Post 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.
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

appending quotes around $query

Post 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>
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

appending quotes around $query

Post by KMandalia »

never mind.

Insted of putting the first line in qpar, it should be the last line of fpar.
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

appending quotes around $query

Post 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
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

appending quotes around $query

Post by mark »

If you want processing why quote it? Maybe define what you really want for the overall query.
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

appending quotes around $query

Post 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.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

appending quotes around $query

Post 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.
Post Reply