White space in searches
Posted: Tue Jun 09, 2009 5:47 am
Hi all,
I am currently trying to fix the search on a website I am trying to develop. What happens is if you search for 'bin' a lot of products come up which contain bin within their product description, this is very annoying as you can imagine because things like post it notes will appear which are totally unrelated.
But when I add spaces into the the search for example (space)bin(space) it will come up with the correct products. I am baffled I have search through the code numerous times and just don't know how to do it. I am a beginner at PHP but hoping to quickly learn so I can get the website running functionally how everyone wants it.
the code is:
any help would be extremely appreciated
I am currently trying to fix the search on a website I am trying to develop. What happens is if you search for 'bin' a lot of products come up which contain bin within their product description, this is very annoying as you can imagine because things like post it notes will appear which are totally unrelated.
But when I add spaces into the the search for example (space)bin(space) it will come up with the correct products. I am baffled I have search through the code numerous times and just don't know how to do it. I am a beginner at PHP but hoping to quickly learn so I can get the website running functionally how everyone wants it.
the code is:
Code: Select all
<?php
$app = $this->globals('khxc_display.app');
$eol = $this->globals('khxc.eol');
$formid = $app . '--minisearch';
$strid = $app . '--prodsearch--string';
$link = $this->link_namespace($app,'prodsearch',array());
$typeid = $app . '--prodsearch--type';
$cgi_value = '';
$this->xhtml_quickform_header($formid,$app,'prodsearchp',array());
print '<p class="hidden"><label for="' . $app . '--minisearch--' . $strid . '"';
print '>Search Term</label></p>' . $eol;
print '<p class="inline"><input class="khxc_quickfield" type="text" name="' . $strid;
print '" id="' . $app . '--minisearch--' . $strid . '" value="';
print $cgi_value . '" size="22" maxlength="100" /></p>' . $eol;
print '<p class="hidden"><input class="khxc_quickfield" type="text" value="EXACT" name=" ' . $typeid;
print '" id="' . $app . '--minisearch--' . $typeid . '" value="ALL" /></p>' . $eol;
$this->xhtml_quickform_footer($formid,'Online Store Search',1);
print '<a class="unfancy" href="' . $link . '" title="Advanced Search">Advanced Search</a>' . $eol;
?>