Ramon K.
Ramon K.

Reputation: 3502

MySQL Full Text Search not working properly. Why?

OBS: I'm new to Full Text Searches and MyIsam engine, so assue I know basically nothing about it.

Here's my DDL:

CREATE TABLE NotebookIndex (
    indexAutomatico TEXT,
    indexHumano TEXT,
    notebook BIGINT UNSIGNED
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=MYISAM;
ALTER TABLE NotebookIndex ADD FULLTEXT(indexAutomatico, indexHumano);

And here's my database right now:

enter image description here

When I query:

SELECT notebook FROM NotebookIndex WHERE MATCH(indexHumano, indexAutomatico) AGAINST ('intel')

I'm getting this:

enter image description here

If you look closely to the print screen, you will be able to see that 'intel' does exists in some of the lines.

Although, if I change 'intel' to 'sony' i get some results. I tried some other (existent) words and it doesn't work either. Why is this happening?

Upvotes: 1

Views: 1696

Answers (1)

Wrikken
Wrikken

Reputation: 70460

If the word is present in more then 50% of the rows, it will be ignored in natural full text searches. If you need results spanning more then 50% of your table, go for BOOLEAN MODE

Upvotes: 3

Related Questions