Skip navigation links

MySQL Forums :: Full-Text Search :: Full Text search on multiple tables?


Advanced 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
Full Text search on multiple tables? 25335 Chris Green 07/29/2005 06:38AM
Re: Full Text search on multiple tables? 15054 parts1 01/05/2006 06:23PM
Re: Full Text search on multiple tables? 11387 nick yahnke 03/24/2006 07:58AM
Re: Full Text search on multiple tables? 9327 Tony Qian 03/25/2006 11:59PM
Re: Full Text search on multiple tables? 21203 jamesturnernz 04/02/2006 11:00AM
Re: Full Text search on multiple tables? 11403 Salomon Valverde 08/29/2006 04:06PM
Re: Full Text search on multiple tables? 9395 Gianluigi Zanettini 10/01/2006 07:47AM
Re: Full Text search on multiple tables? 12432 xingliang cai 11/06/2006 11:27PM


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.