MySQL Forums
Forum List  »  Full-Text Search

Re: Full Text search on multiple tables?
Posted by: jamesturnernz
Date: April 02, 2006 11:00AM

Hello Tony,

I think I know what you are looking for. I want to do the same thing.

I have

tableA.name
tableB.text

In the MATCH( tableA.name, tableB.text ) I want to search both tables for the search string.

At the moment I can join the tables but when I include tableB.text in the MATCH() I get an error even though the coloums are in the result. I hope that makes sense.

If I find a solution will let you know.

Thanks,
=-)

EDIT:
Don't know if this is the way to do it but this is how I have it working!

SELECT *, MATCH( name ) AGAINST('%$search_term%') OR MATCH( text ) AGAINST('%$search_term%') AS score FROM tableA LEFT JOIN tableB ON tableA.tableA_id = tableB.tableB_id WHERE MATCH( name ) AGAINST('%$search_term%') OR MATCH( text ) AGAINST('%$search_term%')

The Key to it was the "OR MATCH( text ) AGAINST('%$search_term%')"

Hope this helps.
=-)




Edited 1 time(s). Last edit at 04/02/2006 11:35AM by jamesturnernz.

Options: ReplyQuote


Subject
Views
Written By
Posted
16903
January 05, 2006 06:23PM
Re: Full Text search on multiple tables?
23064
April 02, 2006 11:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.