Answer the question
In order to leave comments, you need to log in
What is the best way to organize full-text search in MySQL?
There is a table with a list of urls with type text (the number of characters is not known in advance)
CREATE TABLE `mytable` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`list_of_url` TEXT,
PRIMARY KEY (`id`),
FULLTEXT (`list_of_url`)
) ENGINE = MyISAM
SELECT id, MATCH (list_of_url) AGAINST ('/index.php?id=123&edit=1') FROM mytable
SELECT * FROM `mytable` WHERE `list_of_url` LIKE '/index.php?id=123&edit=1'
Answer the question
In order to leave comments, you need to log in
Normalize the table, store each url in a separate entry, then the search will be simple in comparison and as fast as possible.
Why full text search?
You do a regular index on the field and then in the query the usual comparison url='your string'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question