MySQL: how to do multiple searches over the full text of a table

I want to integrate the MySQL full-text search function in my PHP site.

Now I have the following problem.

SELECT *
FROM testtable t1, testtable2 t2
WHERE MATCH (
t1.firstName, t1.lastName, t1.details, t2.firstName, t2.lastName, t2.details
)
AGAINST (
'founder'
);

And I have an error code:

#1210 - Incorrect arguments to MATCH

Do you know why and how to solve it?

Many thanks!

Edit:

I accept the RageZ method:

SELECT *
FROM testtable t1, testtable2 t2
WHERE MATCH (
t1.firstName, t1.lastName, t1.details
)
AGAINST (
'founder'
) OR MATCH( t2.firstName, t2.lastName, t2.details) AGAINST (
'founder'
); 

And I have a new question. If I want to find content that:

AGAINST('founder', 'initiator', 'employee');

How to write a request?

Well, I know that there can only be one criterion.

AGAINST('founder');
+2
source share
2 answers

I think, since full-text search uses some specific indexes, you should split the table into OR

SELECT *
FROM testtable t1, testtable2 t2
WHERE MATCH (
t1.firstName, t1.lastName, t1.details
)
AGAINST (
'founder'
) OR MATCH( t2.firstName, t2.lastName, t2.details) AGAINST (
'founder'
); 
+2
source
AGAINST('founder initiator employee');

or you can use boolean mode with better stuff

0

Source: https://habr.com/ru/post/1740526/


All Articles