Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Fixing the Search Rate Topic   - - - - -

 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 01 February 2012 - 08:37 PM #1

I know this topic has been widely discussed in the past, but I would like to know what the current best solution to the cs cart search problem is.

Are you guys using a third-party site-search?

Tweaking the CS Cart search?

Unless my customers search by part number, they'll never find anything on my site.

The default is to search for "any of these words" in every field.

I've tried to change the search.tpl in skins/{your_skin}/customer/common_templates/

<form action="{""|fn_url}" name="search_form" method="get">
<input type="hidden" name="subcats" value="Y" />
<input type="hidden" name="status" value="A" />
<input type="hidden" name="pshort" value="N" />
<input type="hidden" name="pfull" value="N" />
<input type="hidden" name="pname" value="Y" />
<input type="hidden" name="pkeywords" value="Y" />
<input type="hidden" name="search_performed" value="Y" />
{hook name="search:additional_fields"}{/hook}
<span class="search-products-text">{$lang.search}:</span>
{if !$settings.General.search_objects}
<select name="cid" class="search-selectbox">
<option value="0">- {$lang.all_categories} -</option>
{foreach from=0|fn_get_subcategories item="cat"}
<option value="{$cat.category_id}" {if $mode == "search" && $smarty.request.cid == $cat.category_id}selected="selected"{elseif $smarty.request.category_id == $cat.category_id}selected="selected"{/if} title="{$cat.category|escape:html}">{$cat.category|escape:html|truncate:100:"...":true}</option>
{/foreach}
</select>
{/if}
{strip}
<input type="text" name="q" value="{$search.q}" onfocus="this.select();" class="search-input" />
{if $settings.General.search_objects}
{include file="buttons/go.tpl" but_name="search.results" alt=$lang.search}
{else}
{include file="buttons/go.tpl" but_name="products.search" alt=$lang.search}
{/if}
{if !$hide_advanced_search}
<a href="{"products.search"|fn_url}" class="search-advanced">{$lang.advanced_search}</a>
{/if}
{/strip}
</form>

But there is some other force at work preventing these changes from taking effect. All searches include all fields and my users get back useless lists of hundreds of results.

What's the best way to set up search on a CS Cart site?
My site: 3-Ring Binders and Organization at UniKeep.com.

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3967 posts

Posted 01 February 2012 - 10:41 PM #2

Have you utilized the "Search words" in product details? What I input into the "Search words" field is "Manufacturer MPN Product code Product name".

 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 01 February 2012 - 10:47 PM #3

Yeah, I started out using relevant terms in the "Search Words" field, but quickly found that it didn't matter because all the fields are returned on search. So I stripped it down to just the individual SKUs. We only sell stuff that we manufacture, so there's no point in putting that.

My problem is that the searches are returning too much data. I can't figure out how to make it only read from the pname and pkeywords fields.
My site: 3-Ring Binders and Organization at UniKeep.com.

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3967 posts

Posted 01 February 2012 - 11:00 PM #4

My problem is that the searches are returning too much data. I can't figure out how to make it only read from the pname and pkeywords fields.


They do the same thing with the Quick search addon. Talk about double the size of your database real quick. I edited the addon to only cache the Search words.

 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 01 February 2012 - 11:11 PM #5

Oh, maybe that's my problem. I've got the quick search addon uninstalled. What's the difference between them?
My site: 3-Ring Binders and Organization at UniKeep.com.

 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3967 posts

Posted 02 February 2012 - 12:42 AM #6

Not that big of a deal. Just a quick search drop down that occurs when customer begins typing in the search box.

 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 02 February 2012 - 04:03 PM #7

Oh yeah, I think turned it off because it was conflicting with some other javascript.

Does anyone know how to fix my search problem? What's causing it to ignore the search.tpl and scrape every single field for every product and page?
My site: 3-Ring Binders and Organization at UniKeep.com.

 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2394 posts

Posted 02 February 2012 - 04:31 PM #8

Might be too obvious, but did you clear cs-carts cache?

When life hands you lemons, bring on the Tequila baby!


 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 02 February 2012 - 09:25 PM #9

Yeah, I'm constantly clearing that thing... But any ideas are good ideas at this point.
My site: 3-Ring Binders and Organization at UniKeep.com.

 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 02 February 2012 - 09:29 PM #10

Here's what the URL looks like after a serach:

MYDOMAIN.COM/?subcats=Y&status=A&pshort=N&pfull=N&pname=Y&pkeywords=Y&search_performed=Y&q=MY_SEARCHWORD&dispatch=search.results&x=0&y=0

My site: 3-Ring Binders and Organization at UniKeep.com.

 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2394 posts

Posted 03 February 2012 - 10:19 AM #11

Maybe it's been overwritten by a hook? Did you go into design mode to check which tpl file it's using?

When life hands you lemons, bring on the Tequila baby!


 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 03 February 2012 - 02:53 PM #12

I didn't think of that. Checking the .tpl via design mode led me to realize that it's the top_search.tpl that I'm worried about. Duh.

I commented out the hook, changed the perimeters and got the same results: it's searching all fields.

The weird thing is the url that the search returns has changed to reflect the tpl settings, but the results are the same.

http://www.unikeep.com/?subcats=Y&status=A&pshort=N&pfull=N&pname=Y&pkeywords=Y&search_performed=Y&q=MY_SEARCH&x=0&y=0&dispatch=search.results

What do you suppose "search_performed" means?
My site: 3-Ring Binders and Organization at UniKeep.com.

 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2394 posts

Posted 05 February 2012 - 10:08 PM #13

Have you tried this? http://kb2.cs-cart.c...search-by-all#3

When life hands you lemons, bring on the Tequila baby!


 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 06 February 2012 - 03:55 AM #14

Oh wow. That was really close to what I needed. Except I was trying to change "top search" not "quick search" and I needed to set the opposite effect.

It was in that same file: core/fn.catalog.php around line 3180. Right below the where Knowledge base suggested the additional code I just changed 'any' to 'all' and it seems to have worked.

Man, am I glad you ran across that. I would have never found it.

Thanks!
My site: 3-Ring Binders and Organization at UniKeep.com.

 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2394 posts

Posted 06 February 2012 - 11:13 AM #15

Man, am I glad you ran across that. I would have never found it.

Thanks!


Glad that helped. The knowledge base actually does have some helpful stuff in it :)

When life hands you lemons, bring on the Tequila baby!