Hi, after drupal 6.17 installation, the search function doesn't work. When I'm trying to search something I got this error message:

user warning: Table 'xxxxxxxxx.search_index' doesn't exist query: SELECT SUM(i.score * t.count) AS score FROM search_index i INNER JOIN search_total t ON i.word = t.word INNER JOIN node n ON n.nid = i.sid WHERE n.status = 1 AND (i.word = 'antywirus') AND i.type = 'node' GROUP BY i.type, i.sid HAVING COUNT(*) >= 1 ORDER BY score DESC LIMIT 0, 1 in /home/www/xxxxxxxxxxxxxxxxx/modules/search/search.module on line 946.

Why the table doesn't exist ?
In the search settings, it says that my site is 100% indexed.
I couldn't find any solution. Does anybody know how to solve the problem ?

Comments

ndstate’s picture

I am having the same problem. Any solutions?

ndstate’s picture

Ok, I figured it out. You just need to create the table. Save the following to a file named search_total.sql

Just add in the name of the database at -- Database: `DATABASENAME` below

-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 06, 2010 at 01:23 PM
-- Server version: 5.0.90
-- PHP Version: 5.2.9

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `DATABASENAME`
--

-- --------------------------------------------------------

--
-- Table structure for table `search_total`
--

CREATE TABLE IF NOT EXISTS `search_total` (
  `word` varchar(50) NOT NULL default '',
  `count` float default NULL,
  PRIMARY KEY  (`word`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `search_total`
sooky’s picture

Sorry - can you be more explicit? If I use this file, in what directory do I put it?

If I use phpmyadmin, do you jknow what I should do?

Thanks.

ndstate’s picture

You do all of the above in phpmyadmin. You edit that file I attached with your database name then import it in phpmyadmin

alfthecat’s picture

Another thing you could try is simply uninstalling the search module (under core in your modules listing) and re-install it again.

----
"People make mistakes. To really mess something up you need a computer."

visualfox’s picture

Needed it for a drupal 5 site.
@ndstate your solution was correct but the sql file you gave was for search_total not for search_index

-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 06, 2010 at 01:23 PM
-- Server version: 5.0.90
-- PHP Version: 5.2.9

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `DATABASENAME`
--

-- --------------------------------------------------------

--
-- Table structure for table `search_index`
--

DROP TABLE IF EXISTS `search_index`;
CREATE TABLE IF NOT EXISTS `search_index` (
  `word` varchar(50) NOT NULL default '',
  `sid` int(10) unsigned NOT NULL default '0',
  `type` varchar(16) default NULL,
  `fromsid` int(10) unsigned NOT NULL default '0',
  `fromtype` varchar(16) default NULL,
  `score` float default NULL,
  KEY `sid_type` (`sid`,`type`),
  KEY `from_sid_type` (`fromsid`,`fromtype`),
  KEY `word` (`word`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;