Help me

Help me

am 21.07.2010 17:33:16 von Karthik Pr

--0-1395140122-1279726396=:69994
Content-Type: text/plain; charset=us-ascii


I have created a table as follows but i was not able to use full text search on
a specific data.
create table racebike (id int auto_increment not null primary key, name
varchar(10), user text,fulltext(name,user));

The table is as follows,
+----+---------+---------------------+
| id | name | user |
+----+---------+---------------------+
| 1 | pulsar | style and speed |
| 2 | Harley | stylish and costly |
| 3 | aprilla | good sports bike |
| 4 | honda | costly and speed |
| 5 | suzuki | nominal and speed |
| 6 | Bullet | stylish and classic |
| 7 | Karizma | style and high cc |
| 8 | Fz | bigger and speed |
+----+---------+---------------------+

The query is
mysql> select * from racebike where match (user) against ('speed');


Thanks in advance
Karthik.P.R



--0-1395140122-1279726396=:69994--

Re: Help me

am 21.07.2010 18:11:37 von Mark Goodge

On 21/07/2010 16:33, Karthik Pr wrote:
>
> I have created a table as follows but i was not able to use full text search on
> a specific data.
> create table racebike (id int auto_increment not null primary key, name
> varchar(10), user text,fulltext(name,user));
[snip]
> The query is
> mysql> select * from racebike where match (user) against ('speed');

It should be:

mysql> select * from racebike where match (name,user) against ('speed');

When using a fulltext index, the query has to name all the fields
included in the index, unless you're performing the search in Boolean mode.

http://dev.mysql.com/doc/refman/5.1/en/fulltext-restrictions .html

Mark
--
http://mark.goodge.co.uk

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org