MySQL: how to make multiple table fulltext search

后端 未结 2 693
春和景丽
春和景丽 2020-12-11 09:39

I want to integrate the MySQL fulltext search function in my PHP site.

I have the following problem now.

SELECT *
FROM testtable t1, testtable2 t2
WH         


        
相关标签:
2条回答
  • 2020-12-11 10:14

    I think since full text search use some specific indexes you should separate table by 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'
    ); 
    
    0 讨论(0)
  • 2020-12-11 10:14
    AGAINST('founder initiator employee');
    

    or you can use boolean mode with more good stuff

    0 讨论(0)
提交回复
热议问题