Forums / General Questions / Search Is not displaying all results/Search with Dash (-)

Search Is not displaying all results/Search with Dash (-)

Locked

Views: 2,741

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
15 Feb 2010, 6:02 PM
#1
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Search Is not displaying all results/Search with Dash (-)

Hello,
My company sells parts which are often searched/sold by part number. Such as part # Q2425-69017 or RM1-0013. When we search for these with complete number we get no results. If we search by the portion after the - such as 0013 or 69017 we do get some results. This will not work for us...at all. Is there any suggestions as to what i can do to make this work?

http://www.azcomputing.biz/

Thanks in advance for your help!

16 Feb 2010, 6:12 PM
#2
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

I am really at a loss here. Is there any search alternative?
Thanks

17 Feb 2010, 12:46 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search Is not displaying all results/Search with Dash (-)

This should not be a problem if you have updated the:
/includes/modules/pages/advanced_search_results/header_php.php

correctly with the new field(s) you want included on the search ...

You should have added something on the where_str for the code:

        $where_str .= "(pd.products_name LIKE '%:keywords%'
                                         OR p.products_model
                                         LIKE '%:keywords%'
                                         OR m.manufacturers_name
                                         LIKE '%:keywords%'";

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

17 Feb 2010, 5:20 PM
#4
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

Ajeh:

This should not be a problem if you have updated the:
/includes/modules/pages/advanced_search_results/header_php.php

correctly with the new field(s) you want included on the search ...

You should have added something on the where_str for the code:

    $where_str .= "(pd.products_name LIKE '%:keywords%'
                                     OR p.products_model
                                     LIKE '%:keywords%'
                                     OR m.manufacturers_name
                                     LIKE '%:keywords%'";


I have to be honest I have no idea what you mean here...Should I put this in there?  I am poor with php programming so I dont know if this is something I add in or should change.  Further advise welcomed.  I just want to be able to search for part #'s with - in the middle (not all part #'s have a - in middle but many do)   like RM1-0013
17 Feb 2010, 6:50 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search Is not displaying all results/Search with Dash (-)

You have added new fields to "some table" in your database or you have added new table(s) to your database ...

Where are these fields added?

How are they currently added to the search to be included in the search?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Feb 2010, 3:57 AM
#6
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

This is on an out of the box install (or was when the search problem was not working. Search works it just does not factor in the -

18 Feb 2010, 4:17 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search Is not displaying all results/Search with Dash (-)

You said ...

Such as part # Q2425-69017 or RM1-0013

What field in the products table are you using for the Part # ... :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Feb 2010, 6:17 AM
#8
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

The part # is in the item title or item description. I havnt added any fields/tables for this.

18 Feb 2010, 2:25 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search Is not displaying all results/Search with Dash (-)

So far I cannot reproduce the problem ...

I add the same things to my product descriptions and have no problem on the search ...

I did find your search doesn't appear to work for anything ...

What happens if you switch to the Classic Template?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Feb 2010, 2:52 PM
#10
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

The advanced search is not working right now as I am trying some things. The default template does the same thing. When I search for just 0013 I get results. When I search for rm1-0013 no results found.
Thanks!

18 Feb 2010, 3:06 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search Is not displaying all results/Search with Dash (-)

The only thing I can think of is to do a compare of your files with something like Beyond Compare from scootersoftware.com with a clean Zen Cart vs your site to see if something has been changed in some manner ...

No matter what combination I use, I cannot repeat this error ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Feb 2010, 3:19 PM
#12
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

Yea its somehow gotten worse. now when I search Q5421A no results but 5421 returns results...Arg :( Sad day here.

Actually after posting this I got an idea to check something. Its not the dash causing the problem.....its letters. 1-0013 returns results 2425-67901 returns results, its when I add letters in that the search gets messed up. Is this any more help?

so i can search by words/letters or numbers but I can not mix them...

18 Feb 2010, 3:38 PM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search Is not displaying all results/Search with Dash (-)

It doesn't make sense at all what is happening ...

Zen Cart doesn't care what it is searching for ... so there is something changed in your code ...

The easiest solution is the comparison on clean code against the code on your site to find it ...

You can try replacing the contents of:
/includes/modules/pages/advanced_search/
/includes/modules/pages/advanced_search_results/
/includes/templates/template_default/templates/tpl_advanced_search_default.php
/includes/templates/template_default/templates/tpl_advanced_search_default.php

But there are numerous functions and classes also involved that could be the problem ...

I'd use Beyond Compare, myself ... it would be easier ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Feb 2010, 9:46 PM
#14
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

I have restored all of those to default on the default template and default files and had the same poor success.

I am going to try on a fresh install.

22 Feb 2010, 6:45 PM
#15
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

On a completely fresh install with all default values I have the same problem. I am wondering if there is some setting on my server that is preventing searching with letters and numbers at the same time.

Any help would be appreciated I am trying to go love but without a proper search function Im dead in the water.

22 Feb 2010, 6:53 PM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Search Is not displaying all results/Search with Dash (-)

What version php and MySQL are you using?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Feb 2010, 7:08 PM
#17
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

Database: MySQL 5.0.77
PHP Version: 5.1.6 (Zend: 2.1.0)

23 Feb 2010, 3:12 AM
#18
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

I have tried another completely fresh install on a new server with the same results...I can not imagine this problem is unique to me? Three servers free installs downloaded fresh from this site and I get the same results on all...

23 Feb 2010, 3:34 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Search Is not displaying all results/Search with Dash (-)

Well, since you're getting consistent problems that are not commonly experienced by others, then it stands to reason that there's something unique to your server configuration. I'm guessing your default database collation settings are your problem.
Related discussion: http://www.zen-cart.com/forum/showthread.php?t=143258
I'm guessing you're not using the _ci version, and thus the searches aren't actually working because your database isn't allowing for case-insensitive searches.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Feb 2010, 5:05 PM
#20
azcomp avatar

azcomp

New Zenner

Join Date:
Feb 2010
Posts:
63
Plugin Contributions:
0

Re: Search Is not displaying all results/Search with Dash (-)

I was able to fix the problem by changing the data type to utf8_general_ci

Thanks all for your help!