Hi,
I have a search box on a html page that is not working properly. I think changing the javascript might be the answer but I am not sure. (I am new to this). Basically the search box has a radio button operator with two choices: "AND" and "OR"
When a user types a search item in such as the terms: GUI Graphical User Interface, the search does not know that GUI and "Graphical User Interface" are two separate terms so it interprets the AND selection to be: GUI AND Graphical AND User AND Interface. The OR selection is interpreted as: GUI OR Graphical OR User OR Interface.
If the search was working correctly, I would enter the search text GUI OR "Graphical User Interface" and it would know that I would like to search by either term. You must use the quotes to enclose a phrase that includes spaced between words.
Below is the relevant code for how the words are being parsed:
Anyone have any ideas?
Thanks in advance for this!
I have a search box on a html page that is not working properly. I think changing the javascript might be the answer but I am not sure. (I am new to this). Basically the search box has a radio button operator with two choices: "AND" and "OR"
When a user types a search item in such as the terms: GUI Graphical User Interface, the search does not know that GUI and "Graphical User Interface" are two separate terms so it interprets the AND selection to be: GUI AND Graphical AND User AND Interface. The OR selection is interpreted as: GUI OR Graphical OR User OR Interface.
If the search was working correctly, I would enter the search text GUI OR "Graphical User Interface" and it would know that I would like to search by either term. You must use the quotes to enclose a phrase that includes spaced between words.
Below is the relevant code for how the words are being parsed:
Code:
if(arrayTemp[0] == "searchString") {
strTemp = ''
arrayKey [j] = arrayTemp[0];
arrayTempKeyword = arrayTemp[1].split('+');
for(k=0; k<arrayTempKeyword.length; k++) {
strTemp += unescape(arrayTempKeyword[k]) + " ";
}//for
strTemp = strTemp.substring(0,strTemp.length-1);
arrayValue [j] = strTemp
}
Thanks in advance for this!