Hi,
I have a question about using the search query and the logic of the results it returns.
Let's say I search using the query:
/search.php?q=ladies+gloves
The result I get is a list of all instances where 'ladies' OR 'gloves' is found.
How do I limit the results to only instances where 'ladies' AND 'gloves' is found.
Is there a thread or somewhere I can refer to for Search query logic (and the code to use).
Many thanks,
Neil
I can't seem to get this working. I have changed and uploaded the search.php (I presume that is a zero not O)
http://www.littlemisstshirts.com/little-miss/little-miss-chatterbox.php has the following code, which includes items with Miss:
<?php
$common_path = "/home/papillon/public_html/fashion/";
$common_baseHREF = "http://www.papillonnet.com/fashion/";
$_GET["q"] = "little miss chatterbox";
require($common_path."searchExternal.php");
?>
I have tried putting in little+miss+chatterbox but it won't show any results with that
---------
Jill
Hi Jill,
The searchExternal.php script contains all the search code itself, it does not use search.php, so the modification would have to be made in within searchExternal.php itself. If you use the Search function of your text editor to look for
$useFullText
...and replace that with zero as above, that should do the trick...
Cheers,
David.
Got it working but in fact need to change $useFullText = TRUE; to $useFullText = FALSE;
Thanks David!
---------
Jill
Is there a way we can get the search to stick to full words. For instance, I have a search for "CKY" - meaning the group, but it of course brings up everything including "Ladies Ducky Poos Count Duckula T Shirt" - which I doubt those visitors would be interested in
If not it's no big deal, just be nice.
---------
Jill
Hi Jill,
Could you perhaps drop me an email with some example searches (and a link to the site) and I'll have a look - there are normally things that can be done quite easily to handle specific oddities like this...
Cheers,
David.
Hello Neil,
What you're observing is the default behavior of the full text search method. The easiest way to change your site over to AND logic is to force the normal index method for all queries. Quite a few users choose to do this as it can return better results on some types of site.
To do this, simply replace the following code on line 77 of search.php:
if ($useFullText)
..to just:
if (0)
...and it should then work as required.
Cheers,
David.