View Full Version : Search function does not work.

06-29-2005, 05:59 AM
Click Advanced Search, enter anything in the search box, click Search .... returns No Results. Click the Back button from there and get this fatal error:

1146 - Table 'ggbig_com_osc3.searchword_swap' doesn't exist

SELECT * FROM searchword_swap


Let me stress here that the Search function does NOT work. I have an item named 'test' and Search cannot locate the item.

Quick search and Advanced search do not work. Verified with the default install of osCMax 2-1.

UPDATE: Search returns no results only if no categories are defined.

06-29-2005, 07:24 AM
DOH! How about mentioning that you have tried to hack in a search mod...

The searchword_swap table is not part of osCMax. You have added a mod that is looking for this table. Why not mention that in your post?

The default search and advanced search work fine, and I have verified this. Your half baked mod install is the problem. Remove it or fix it by actually adding the searchword_swap table to your DB and everything will work fine.

06-29-2005, 08:40 AM
Hello ...

It's in the current version:

grep for searchword_swap and get:

catalog/advanced_search.php: $sql_words = tep_db_query("SELECT * FROM searchword_swap");

On line 31

I could have fixed this, yes. Just thought you would want to know so you could fix. I've been programming since the early 80's and after reading your response .. you seem juvenile. If this is not the case, try not to assume you are talking to an idiot on the other end. Some of us have been at this longer than even you.

I just downloaded v2 RC1 again just to verify this and it is there.

06-29-2005, 09:25 AM
Yes, I admit it, I can be immature and impatient. I can be quite abrasive at times. On the other hand, I can also be kind and understanding. It really depends on my mood. I bet you have similar ranges in personality. Here's to being human...

Thanks, but I cannot reproduce the error. I have tested it on 3 systems without any issue. Searches work fine and return relevant results. No mysql errors are generated.

Yes, that line of code is present, but not generating errors in any of the test shops. I am not 100% sure how that even got into the codebase. I will have to look over the CVS commits. It seems like a halfway installed contribution.

I retract my reckless Homerism, as it was not a Homer moment and did not warrant it. We all know the damage that can be done when wantonly spewing them.

What system are you running this on? Versions of mysql, php, apache, linux please.

06-29-2005, 09:44 AM
Hey, I was just able replicate your error, but not the way you describe it. I can only generate the error when clicking the 'back' button after making a search.

06-29-2005, 09:58 AM
Here is the fix. Run the following query on your DB:

CREATE TABLE `search_queries` (
`search_id` int(11) NOT NULL auto_increment,
`search_text` tinytext,
PRIMARY KEY (`search_id`)
# --------------------------------------------------------

# Table structure for table `search_queries_sorted`
# Creation: May 15, 2003 at 05:07 AM
# Last update: May 17, 2003 at 09:32 PM

CREATE TABLE `search_queries_sorted` (
`search_id` smallint(6) NOT NULL auto_increment,
`search_text` tinytext NOT NULL,
`search_count` int(11) NOT NULL default '0',
PRIMARY KEY (`search_id`)
# --------------------------------------------------------

# Table structure for table `searchword_swap`
# Creation: May 11, 2003 at 03:45 AM
# Last update: May 17, 2003 at 09:33 PM

CREATE TABLE `searchword_swap` (
`sws_id` mediumint(11) NOT NULL auto_increment,
`sws_word` varchar(100) NOT NULL default '',
`sws_replacement` varchar(100) NOT NULL default '',
PRIMARY KEY (`sws_id`)

07-07-2005, 01:50 AM
I'm getting same problem...

1146 - Table 'shockproof_gem.searchword_swap' doesn't exist

SELECT * FROM searchword_swap


Can I run the fix on my DB to fix this problem too?

07-07-2005, 06:26 AM
Same problem = same fix.

08-09-2005, 09:13 PM
Same problem = same fix.

im getting the same prob :( newbie? here, how do i run/use the code you posted msasek ?

08-15-2005, 10:00 PM
nm i got it :D