TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-09-2008, 03:53 PM   #1 (permalink)
The Acquainted
Inquisitive 
 
WinSrev's Avatar
 
Join Date: Sep 2007
Posts: 133
Thanks: 6
WinSrev is on a distinguished road
Application Error MySQL5 Fulltext

Hey,

Been trying to search through my database using fulltext, i used the query:
Code:
SELECT *
FROM `table1`
LEFT JOIN `table2` ON `table1`.`col1` = `table2`.`col2`
WHERE MATCH (
major1, major2
)
AGAINST (
'theory'
)
LIMIT 0 , 30
But the problem it gives an error:
Quote:
#1191 - Can't find FULLTEXT index matching the column list
although running each column seperatly works. Any ideas?

Thanks!
Send a message via ICQ to WinSrev
WinSrev is offline  
Reply With Quote
Old 02-09-2008, 05:19 PM   #2 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

You probably ment:

Code:
SELECT *
FROM `table1` tbl1
LEFT JOIN `table2` tbl2 ON `table1`.`col1` = `table2`.`col2`
WHERE MATCH (
tbl2.major1, tbl2.major2
)
AGAINST (
'theory'
)
LIMIT 0 , 30
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 02-09-2008, 05:36 PM   #3 (permalink)
The Acquainted
Inquisitive 
 
WinSrev's Avatar
 
Join Date: Sep 2007
Posts: 133
Thanks: 6
WinSrev is on a distinguished road
Default

Can't be that, it produces the same error.
Send a message via ICQ to WinSrev
WinSrev is offline  
Reply With Quote
Old 02-09-2008, 06:38 PM   #4 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Try creating a new index - MySQL AB :: MySQL 5.0 Reference Manual :: 11.1.4 CREATE INDEX Syntax - on the tables and your searchable columns to see if that helps.

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 02-09-2008, 06:42 PM   #5 (permalink)
The Acquainted
Inquisitive 
 
WinSrev's Avatar
 
Join Date: Sep 2007
Posts: 133
Thanks: 6
WinSrev is on a distinguished road
Default

Well, i know for a fact that they have indexes because as i said they work seperatly but wont work together for some reason.
Send a message via ICQ to WinSrev
WinSrev is offline  
Reply With Quote
Old 02-09-2008, 06:48 PM   #6 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Indeed. The only reason I can think of is a corrupt index somewhere (even though they work seperately), hence the index rebuild.

Hell, it's worth a try anyway?

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 02-09-2008, 06:53 PM   #7 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Also, when you created your table did you create it with FULLTEXT(major1, major2)? or seperately?

Edit: Having done some testing, I reckon this is where the problem lies. To use MATCH(major1, major2), your create table statement would have needed "...FULLTEXT(major1, major2)...", I'm guessing that it had "...FULLTEXT(major1), FULLTEXT(major2)..." which is why it works on single column searches.

Alan

Last edited by Alan @ CIT : 02-09-2008 at 07:13 PM. Reason: Did some testing
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
The Following User Says Thank You to Alan @ CIT For This Useful Post:
WinSrev (02-09-2008)
Old 02-09-2008, 08:45 PM   #8 (permalink)
The Acquainted
Inquisitive 
 
WinSrev's Avatar
 
Join Date: Sep 2007
Posts: 133
Thanks: 6
WinSrev is on a distinguished road
Default

Yeah, i see what you mean, but, what if i want to do it over 2 tables? think that would be possible?
Send a message via ICQ to WinSrev
WinSrev is offline  
Reply With Quote
Old 02-09-2008, 08:50 PM   #9 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

MySQL AB :: Re: Full Text search on multiple tables? - That post may help - he seems to be doing a full text search across two tables.

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 02-10-2008, 12:40 AM   #10 (permalink)
The Acquainted
Inquisitive 
 
WinSrev's Avatar
 
Join Date: Sep 2007
Posts: 133
Thanks: 6
WinSrev is on a distinguished road
Default

Thanks for all your help Alan, problem solved.
Send a message via ICQ to WinSrev
WinSrev is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:52 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design