473,554 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FULLTEXT Searching

I have to do a catalog search through multiple tables and columns for
product model number, description, and name. I realize that doing
pattern matching with multiple LIKE statements is slow so I found that
FULLTEXT searches is a better alternative.

I have added a FULLTEXT index to the tables I'm searching, but I get an
unkown error when I run my query:

SELECT p2c.categories_ id, p.products_id, pd.products_nam e,
p.products_quan tity, p.products_imag e, p.products_bima ge,
p.products_pric e, p.products_date _added, p.products_last _modified,
p.products_date _available, p.products_stat us
FROM products p, products_descri ption pd, products_to_cat egories p2c
WHERE MATCH(p.product s_model,pd.prod ucts_name,pd.pr oducts_descript ion)
AGAINST('pumps' )
AND p.products_id = pd.products_id
AND p.products_id = p2c.products_id
ORDER BY pd.products_nam e;

This is how my table structures look:

CREATE TABLE `products` (
`products_id` int(11) NOT NULL auto_increment,
`products_quant ity` int(4) NOT NULL default '0',
`products_model ` varchar(12) default NULL,
`products_image ` varchar(64) default 'image_na.gif',
`products_bimag e` varchar(64) default 'image_na.jpg',
`products_price ` decimal(15,4) NOT NULL default '0.0000',
`products_date_ added` datetime NOT NULL default '0000-00-00 00:00:00',
`products_last_ modified` datetime default NULL,
`products_date_ available` datetime default NULL,
`products_weigh t` decimal(5,2) NOT NULL default '0.00',
`products_statu s` tinyint(1) NOT NULL default '0',
`products_tax_c lass_id` int(11) NOT NULL default '0',
`manufacturers_ id` int(11) default NULL,
`products_order ed` int(11) NOT NULL default '0',
PRIMARY KEY (`products_id`) ,
KEY `idx_products_d ate_added` (`products_date _added`),
FULLTEXT KEY `products_model ` (`products_mode l`)

CREATE TABLE `products_descr iption` (
`products_id` int(11) NOT NULL auto_increment,
`language_id` int(11) NOT NULL default '1',
`products_name` varchar(64) NOT NULL default '',
`products_descr iption` text,
`products_url` varchar(255) default NULL,
`products_viewe d` int(5) default '0',
PRIMARY KEY (`products_id`, `language_id`),
KEY `products_name` (`products_name `),
FULLTEXT KEY `products_name_ 2`
(`products_name `,`products_des cription`)

MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1747

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: JT | last post by:
I have a MySQL fulltext search form in place and I now want to filter the results further. I've added a few multiple select boxes on my form (ResourceType and Topic), and I'm able to build and execute the SQL queries properly. The problem is that when I add the criteria for "ResourceTyoe" and "Topic", it seems to take precedence over the...
by: Phil Powell | last post by:
Relevancy scores are normally defined by a MySQL query on a table that has a fulltext index. The rules for relevancy scoring will exclude certain words due to their being too short (minimum default is 4 letters). This is the Fed. Everything is a TLA (three-letter acronym). Therefore, since I'm building a PORTABLE web application,...
by: Matt W | last post by:
Hi all, I'm planning to use MySQL's full-text search for my forum system (possibly 5+ million posts). I've been playing with it a lot lately to see the performance and functionality and have some suggestions/questions. First, since a few of you may be wanting to know, here is a thread where I was doing some speed/optimization tests and...
by: Radim B | last post by:
Hi, can anyone help me if it is possible to make indexing for fulltext from formats in: 1) *.doc 2) *.xls 3) *.html 4) *.pdf Many thanx for your help
by: Phil Powell | last post by:
Retracing my problem leads me to believe I never successfully created fulltext indexes for MySQL 3.23.58 MyISAM tables. I went to the MySQL manual and was able - or so I thought - to create them, however, my fulltext search queries fail in 3.23.58 but the exact queries (with same data) work perfectly in 4.0.10. --...
by: Mike Reef | last post by:
I'm trying fulltext searching for the first time , but I can't figure out why the example in the mySQL manual is *not* working. mysql> SELECT * FROM articles -> WHERE MATCH (title,body) AGAINST ('database'); Empty set (0.00 sec) mysql> SELECT id, MATCH (title,body) AGAINST ('Tutorial') -> FROM articles;...
by: Alex Glass | last post by:
I have a large contacts table with about 30 columns of text fields and 5 fulltext indexes spanning the different sections of the table. I'm curious if anyone could suggest a better way to find rows in the table based on text entered by the user. It also would be nice if wildcards could be supported like "beginning*". The query I have built...
by: Robert Oschler | last post by:
I read a while back that MySQL will only use one index per query. (If this is not so, please tell me and point me to a doc that gives a good explanation of MySQL's current index usage policy). I'm using MySQL 4.2.x. Here's my dilemma. 1) --------- I have two tables that have records with a FULLTEXT index text field in each of them. ...
by: luckysingh | last post by:
I've tried searching alot on the net but am not able to find how to allow a user (not admin/owner) to be able to create & populate the FullText Indexing Catalogs on the tables he creates. Currently although with admin account, I can create FullText Catalogs but I have to provide the permissions to build & populate catalogs to some user, so that...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.