List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 27 2002 1:59am
Subject:Re: [Newbie] MATCH and INDEX question (using a JOIN in a MATCH
statement)
View as plain text  
At 13:43 -0700 3/26/02, Dan Tappin wrote:
>This is a follow-up to a MySQL keyword text search question I had answer a
>few days ago.
>
>I have table 'main' which has two INT columns 'maincat' and 'subcat' which
>hold an index number from to other tables maincat and subcat.  These table
>each hold descriptive names ('name') for each of the main categories and sub
>categories.
>
>I have no problem using MATCH to search the various fields of 'main' using
>an INDEX.  The problem is I want to create a search across the related
>'name' fields of the other two tables.
>
>Here is what I have so far:
>
>select main.id, description, maincat.name, subcat.name from main LEFT JOIN
>clients ON forsale.clientid=clients.id WHERE MATCH (description) AGAINST
>('keywords')
>
>This works but I can only MATCH in the columns of 'main'.
>
>Now my first thought was to try this:
>
>select main.id, description, maincat.name, subcat.name from main LEFT JOIN
>clients ON forsale.clientid=clients.id WHERE MATCH (description,
>maincat.name, subcat.name) AGAINST ('keywords')
>
>Which results in an error.
>
>Can anyone tell me if I can do this using MATCH?

Nope.

The columns named in the MATCH() must match the columns for a FULLTEXT
index, and indexes don't cross tables.

>
>Thanks,
>
>Dan

Thread
[Newbie] MATCH and INDEX question (using a JOIN in a MATCHstatement)Dan Tappin26 Mar
  • Re: [Newbie] MATCH and INDEX question (using a JOIN in a MATCH statement)Paul DuBois27 Mar
    • Re: [Newbie] MATCH and INDEX question (using a JOIN in a MATCH statement)Dan Tappin27 Mar
    • Re: [Newbie] MATCH and INDEX question (using a JOIN in a MATCH statement)Dan Tappin28 Mar