MySQL documentations gives this format for creating a FULLTEXT index:
| {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...) [index_option]
To implement full-text search with MySQL you can either create index by writing :
CREATE TABLE posts (
id int(4) NOT NULL AUTO_INCREMENT,
title varchar(255) NOT NULL,
content text,
PRIMARY KEY (id),
FULLTEXT (title, content)
) ENGINE=MyISAM;
OR
CREATE TABLE posts (
id int(4) NOT NULL AUTO_INCREMENT,
title varchar(255) NOT NULL,
content text,
PRIMARY KEY (id),
FULLTEXT KEY my_index_name (title, content)
) ENGINE=MyISAM;
with my_index_name
a user defined name and not a field name.
- What is the difference between them?
- Is there any consequence for the system itself and for the developer ?
I am not able to find any clue in the docs: