Lot of filters search ¿match ... against?

47 Views Asked by At

I'm trying to make a filter search that matches like 12 variables got from forms, to 12 different columns in my database. Can this be done with the MATCH...AGAINST that I used to search just one thing, or I need other stuff?

Thank you ^^

1

There are 1 best solutions below

0
On

Yes, you can do it, but you need to set full text index on all 12 column together.

ALTER TABLE tableName ADD FULLTEXT INDEX indexName (col_1 ASC, col_2 ASC, col_3 ASC, col_12 ASC);

Then you can search like this:

select * from table name where match(col_1,col_2,col_3,col_12) against("word_1 word_2 word_3 word_12");

[I wrote 4 columns and words, according to you change code.]