PDA

View Full Version : Search for all words only


jxm28788
06-Sep-2006, 09:49 AM
At the moment the search facility has the option of searching for 'all' words, or 'any' words.

How do I take that option out so it just searches for all words?

I'm guessing it's this bit, but not sure how to remove the options and set the value...

NETQUOTEVAR:SEARCHCOMBINE
<input type=RADIO name="TB" CHECKED value="A">
NETQUOTEVAR:SEARCHANDSTRING
<input type=RADIO name="TB" value="O">
NETQUOTEVAR:SEARCHORSTRING&nbsp;NETQUOTEVAR:SEARCHCOMBINEINFO
<script language="JavaScript">
<!--
for (nIndex = 0; nIndex < document.forms.length; nIndex++)
{
if (document.forms[nIndex] && document.forms[nIndex].SS)
{
document.forms[nIndex].SS.focus();
}
}
// -->
</script>

Krithika
08-Sep-2006, 08:52 AM
Hi John

I'm guessing it's this bit.....
Bull's eye. :) All you need to do is replace these lines :


NETQUOTEVAR:SEARCHCOMBINE
<input type=RADIO name="TB" CHECKED value="A">
NETQUOTEVAR:SEARCHANDSTRING
<input type=RADIO name="TB" value="O">
NETQUOTEVAR:SEARCHORSTRING&nbsp;NETQUOTEVAR:SEARCHCOMBINEINFO


...with this one :

<input type=HIDDEN name="TB" value="A">

Save the file and update the site. This should now make search look for ALL the words.

jxm28788
08-Sep-2006, 10:16 AM
yup, that fixed it - thanks.:)

jxm28788
11-Sep-2006, 10:06 AM
ah, that's seems to only work on the main search - I've just tried a 'quick search' and it came up with the error -

"Missing text search join mode. Please specify AND or OR."

Any ideas?

Krithika
11-Sep-2006, 11:53 AM
Hi John

Checking this now...

Krithika
11-Sep-2006, 12:59 PM
Hi there

I re-tested the same workaround on my default store and both Quick and Advanced Search work OK for me. Could you upload your Act_SearchTemplate.html so I can have a look?

jxm28788
11-Sep-2006, 01:37 PM
<!-- SearchTemplate HTML begin -->
<!-- Add Search Page header HTML here -->

<input type=HIDDEN name="PAGE" value="SEARCH">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="CUSTOMVAR:ACTSTDWIDTH" ALIGN="CENTER">
<tr>
<td width="90%" valign=TOP align=LEFT>
<span class="actlarge"><BR /><B>Enter Search Text:</b><br /><BR /> </span>
</td>
<td>&nbsp;</td>
</tr>
</table>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="CUSTOMVAR:ACTSTDWIDTH" ALIGN="CENTER">
<tr><td valign="top" align="center"><img src="down-arrow.gif" width="50" height="34" alt=""><td>
<td width="85%" valign="TOP" align="left">
<table border=0 cellspacing=0 cellpadding=3 width="95%">
<tr>
<td valign="TOP"> <b>NETQUOTEVAR:SEARCHSTRING</b><br>
<input type=TEXT name="SS" size=40 maxlength=255>
<br>
<!-- NETQUOTEVAR:SEARCHCOMBINE
<input type=RADIO name="TB" CHECKED value="A">
NETQUOTEVAR:SEARCHANDSTRING
<input type=RADIO name="TB" value="O">
NETQUOTEVAR:SEARCHORSTRING&nbsp;NETQUOTEVAR:SEARCHCOMBINEINFO -->

<input type=HIDDEN name="TB" value="A">

<script language="JavaScript">
<!--
for (nIndex = 0; nIndex < document.forms.length; nIndex++)
{
if (document.forms[nIndex] && document.forms[nIndex].SS)
{
document.forms[nIndex].SS.focus();
}
}
// -->
</script>
</td>
<!-- <td valign="TOP"> <b>NETQUOTEVAR:PRICERANGELABEL</b><br>
NETQUOTEVAR:PRICERANGECONTROL </td> -->
</tr>
NETQUOTEVAR:SEARCHPROP
<!-- <tr><td colspan=2 valign="BOTTOM"> <b>NETQUOTEVAR:SECTIONCONTROLLABEL</b><br>
NETQUOTEVAR:SECTIONCONTROL </td></tr>-->
<tr>
<td colspan=2 valign="BOTTOM">
<input type=SUBMIT name=ACTION value="NETQUOTEVAR:SEARCHLABEL">
</td>
</tr>
</table>
</td>
</tr>
<!-- <tr><td valign="TOP">NETQUOTEVAR:SPLASHTEXTBODY NETQUOTEVAR:INFOLINES </td></tr>-->
</table>
<!-- Add Search Page footer HTML here -->
<!-- SearchTemplate HTML end -->

Krithika
11-Sep-2006, 04:48 PM
Hi John

I replaced the code in my defalut Act_SearchTemplate.html with that pasted in your reply. Search and quick search still work OK for me. I have uploaded the default site, using your search template here (http://testapache.actinic.com/~krithika/index.html)

Please check this and let me know if I am looking in the wrong place.

P.S: To remove the price and section drop-downs, you can alternatively simply uncheck the options - Allow searching by sections and Allow searching by Price bands in View | Search Settings.

jxm28788
12-Sep-2006, 12:48 PM
hmm. I backed out the changes to the main search and simple search is still broken, must be another change I made. How does this look?<!-- SIMPLESEARCH HTML BEGIN -->
<table cellspacing=0 cellpadding=0 border=0>
<form name=simplesearch action="NETQUOTEVAR:SEARCHCGIURL" METHOD="NETQUOTEVAR:CGIMETHOD">
<tr>
<td background="nav-bar-background-red.gif" valign=middle noWrap align=left>
<input type="TEXT" name="SS" size="16" maxlength="125" value="NETQUOTEVAR:QUICKSEARCHLABEL" onFocus="this.value='';this.style.background='#FFFFFF'"></td>
<td width="10" bgcolor="0091b4"><img src="nav-bar-background-red.gif" height="26" width="4"></td>
<td align="left" valign="top"><input type="image" border="0" name="ACTION" src="crazy-daves-search-button-1.gif" alt="NETQUOTEVAR:QUICKSEARCHBUTTONTEXT" onMouseOver="src='crazy-daves-search-button-2.gif' " onMouseOut="src='crazy-daves-search-button-1.gif' "></td>
<td width="10" bgcolor="0091b4"><img src="nav-bar-background-red.gif" height="26" width="4"></td>
</tr>
</form>
</table>