Search code examples
mysqlfull-text-searchfull-text-indexing

Full Text search and Subqueries in the FROM Clause


When i try the following query:

select co_id, Match(co_title,co_description,co_text) AGAINST ('word')  from (select * from content limit 100)co

the result is: #1191 -Can't find FULLTEXT index matching the column list

FULLTEXT indexes are set correctly :

when i try :

select co_id, Match(co_title,co_description,co_text) AGAINST ('word') from content

it works fine.

why the first query is not working?


Solution

  • That's not about FULLTEXT only, actually - that is because you're referring to subquery (in FROM clause) which is runtime-created table (rowset) and have not any indexes, so FULLTEXT also as well.

    I suggest this:

    SELECT 
      co_id, 
      MATCH(co_title,co_description,co_text) AGAINST ('word') 
    FROM 
      content 
    LIMIT 100