MySQL Forums
Forum List  »  Full-Text Search

Syntax Error while running a match/against query
Posted by: sam jeffry
Date: August 06, 2009 03:12AM

I have copy/pasted a query from mysql manual and have run it. But I have retrieved two different results on two different servers. The first one is exactly as is expected in the manual but the second one tells that there seems to be a syntax error.

The first server (Which is the test server) is a development computer with xampp installed (MySQL Ver 5.1.33) and the 2nd one (which is the main server) is a host with MySQL Ver 5.0.51a

Here is what exactly I did:

1- I built a table with 3 columns named id, title and body while indicating body and title as the parts for furthure full-text-search. Here is the create table code:

CREATE TABLE articles
(id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200), body TEXT, FULLTEXT (title,body));

2- I inserted the sample records mentioned in mysql manual:

INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...'),
('How To Use MySQL Well','After you went through a ...'),
('Optimizing MySQL','In this tutorial we will show ...'),
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');

3- Then I copy/pasted the sample query with "MATCH...AGAINST..." command:

SELECT * FROM articles
WHERE MATCH (title,body)
AGAINST ('database' IN NATURAL LANGUAGE MODE);

When I ran the above query in the test server, it returned two records. But when I ran it in the main server, it returned the following error:

You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version
for the right syntax to use near 'NATURAL LANGUAGE MODE)' at line 3

Is it because of the MySQL version or anything I am missing?

Options: ReplyQuote


Subject
Views
Written By
Posted
Syntax Error while running a match/against query
6130
August 06, 2009 03:12AM


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

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.