MySQL Forums
Forum List  »  Full-Text Search

Search Query
Posted by: hellobhaskar
Date: July 11, 2007 09:48PM

Hi,

i am designing a tool which stores all the documents.I need to design a search box which take user input query and generates the results.
The database schema is

uploads
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| upload_id | int(11) | | PRI | NULL | auto_increment |
| upload_date | datetime | YES | | NULL | |
| uploaded_by | varchar(100) | | | | |
| stored_path | varchar(200) | | | | |
| client_id | int(11) | | | 0 | |
| product_id | int(11) | YES | | NULL | |
| description | varchar(200) | YES | | NULL | |
| tags | varchar(50) | YES |Mul | NULL | |
| filename | varchar(100) | | | | |
| category_id | int(11) | YES | | NULL | |
+-------------+--------------+------+-----+---------+----------------+

alter table uploads add fulltext(tags,filename,description);


client
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| client_id | int(11) | | PRI | NULL | auto_increment |
| client_name | varchar(200) | | | | |
+-------------+--------------+------+-----+---------+----------------+


category
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+----------------+
| category_id | int(11) | | PRI | NULL | auto_increment |
| category_name | varchar(200) | YES | | NULL | |



product
+--------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+----------------+
| product_id | int(11) | | PRI | NULL | auto_increment |
| product_name | varchar(200) | YES | | NULL | |
+--------------+--------------+------+-----+---------+----------------+

alter table uploads add fulltext(tags,filename,description);


ex.If i need to search for word 'pepsi' it should it look for the work in client name,product name,filename,category name ,tags, and description.Please help me with the best suited query for that ?I want to use mysql full text capability.what shoud i do ?

Options: ReplyQuote


Subject
Views
Written By
Posted
Search Query
5194
July 11, 2007 09:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.