2 or more tables with FULLTEXT index

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • saavedrajj

    2 or more tables with FULLTEXT index

    Hi everybody, I need some help. I've started to develop a search for
    my PHP site, and I'm using FULLTEXT index

    After all, I created the indexs in the required search fields "title"
    and "text":
    ALTER TABLE table1 ADD FULLTEXT(title, text);

    and with the following query:
    SELECT * FROM table1 WHERE MATCH(title, text) AGAINST
    ('$search_strin g');

    returns me the results that I want, for the search in table1.

    Until now, everything works fine.

    I want to include on this search: table2 and table3, both tables have
    different structure, but they have the some common fields, title and
    text.

    Is there any way to put in the same query, the search for a string
    in 3 differents tables?

  • Captain Paralytic

    #2
    Re: 2 or more tables with FULLTEXT index

    On 14 Jun, 17:03, saavedrajj <saavedr...@gma il.comwrote:
    Hi everybody, I need some help. I've started to develop a search for
    my PHP site, and I'm using FULLTEXT index
    >
    After all, I created the indexs in the required search fields "title"
    and "text":
    ALTER TABLE table1 ADD FULLTEXT(title, text);
    >
    and with the following query:
    SELECT * FROM table1 WHERE MATCH(title, text) AGAINST
    ('$search_strin g');
    >
    returns me the results that I want, for the search in table1.
    >
    Until now, everything works fine.
    >
    I want to include on this search: table2 and table3, both tables have
    different structure, but they have the some common fields, title and
    text.
    >
    Is there any way to put in the same query, the search for a string
    in 3 differents tables?
    Please do NOT multi-post
    Cross-post if you really think it necessary but DO NOT CROSS POST. It
    wastes people's time.

    Comment

    Working...