Improved Search Function
I need some help with my xcart search. Whenever a customer enters a phrase that is more than two words, the search rarely picks up the products unless an exact match is found. What I need is for it to pick up one of the words in the phrase or both words but not together. How can I do this. My current search.php search looks like this
Code:
$search_query = "($sql_tbl[products].product like '%$substring%' or $sql_tbl[products].descr like '%$substring%') and $sql_tbl[categories].category like '$search_category%' and $sql_tbl[products].forsale='Y' and $sql_tbl[categories].avail='Y' $price_condition "; Any help is appreciated. -Bradley |
This is quite a detailed mod....doable, but detailed.
What version are you running? |
I'm running 3.3.5. What type of mod would I be looking at?
-Bradley |
Yeah, we really need to do something about this since x-cart isn't. That's one of the things on my list is to modify it so the stupid search actually works well enough to be used on a site. I think we all lose lots of customers to this.
|
I agree completely, that is why I'd like to get the search fixed on my site. Many customers are complaining that their searches never turn up any results....the search is way too sensitive. The products I sell are referred to by several different names, so I need something that is much less sensitive. If my customers don't see a product when they search for it, then most likely they won't buy. Let's try to get a lot of support on this. I'd even be willing to pay for a mod if it wasn't a ridiculous price.
-Bradley |
Integrating this type of feature might do it well:
http://www.daemonprojects.com/phpsnip/view.php?snip=7 Currently all the search terms have to be in order, so this would break the search terms apart and find the search terms even if they are not all together. Would be a start, anyway. Any other ideas? Some other links: http://www.phpbuilder.com/columns/clay19990421.php3 http://www.mysql.com/doc/en/Fulltext_Search.html http://search.mnogo.ru/ http://swish-e.org/ |
something like:
Code:
<? Please note that has not been tested :!: |
Hmm.. it looks right, but still got an error:
test is the first word, and test2 is the second Quote:
Maybe the [i] needs to be added to the %$substring[i]% like the example? |
Thanks for the quick work on this. The code gives me the following error in 3.3.5
"Parse error: parse error in /xcart2/search.php on line 61" I get this when I copy and paste only the new section into my code. Copying the code completely gives me a parse error on line 54...Any other tips? Thanks again, Bradley |
this works in 3.4.2 (based off from funkydunk's fix above)...
adds support for searching fulldescription, desc, productid, product here it is: (look near the "LOOK HERE"s) Code:
<? thanks funkydunk!!![/b] |
All times are GMT -8. The time now is 04:12 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.