Welcome Guest, Not a member yet? Register   Sign In
Can't find FULLTEXT index matching the column list
#1

[eluser]eckelarsson[/eluser]
Hello!
Trying out FULLTEXT search and a get an anyoing error when trying to match with two columns.

Using code
Code:
$this->db->where('MATCH (Foretag, SNI) AGAINST ("'. $fritext .'")', NULL, FALSE);

Get error
Code:
A Database Error Occurred
Error Number: 1191

Can't find FULLTEXT index matching the column list

SELECT * FROM (`em_register`) WHERE MATCH (Foretag, SNI) AGAINST ("Butik") LIMIT 5

When i try with only one column it works fine (with both colum "Foretag" and "SNI").

What causes this?
#2

[eluser]eckelarsson[/eluser]
[quote author="eckelarsson" date="1243885498"]Hello!
Trying out FULLTEXT search and a get an anyoing error when trying to match with two columns.

Using code
Code:
$this->db->where('MATCH (Foretag, SNI) AGAINST ("'. $fritext .'")', NULL, FALSE);

Get error
Code:
A Database Error Occurred
Error Number: 1191

Can't find FULLTEXT index matching the column list

SELECT * FROM (`em_register`) WHERE MATCH (Foretag, SNI) AGAINST ("Butik") LIMIT 5

When i try with only one column it works fine (with both colum "Foretag" and "SNI").

What causes this?[/quote]


Found me a solution.
Needet to this, on both fields at the same time.
ALTER TABLE 'table' ADD FULLTEXT('field', 'field', etc etc);
#3

[eluser]TheFuzzy0ne[/eluser]
Well spotted. That was going to be my suggestion.
#4

[eluser]aidehua[/eluser]
@eckelarsson

Thanks for posting this solution - I was stuck on this for a while. I had both columns set up as FULLTEXT indexes - but I had set them separately:

ALTER TABLE ‘table’ ADD FULLTEXT(‘field1’);
ALTER TABLE ‘table’ ADD FULLTEXT(‘field2’);

And I was getting the same error message that you report:

"Can't find FULLTEXT index matching the column list."

Incidentally, it DID work OK when I ran the MATCH query IN BOOLEAN MODE:

SELECT * FROM (`em_register`) WHERE MATCH (Foretag, SNI) AGAINST ("Butik" IN BOOLEAN MODE) LIMIT 5

It was only running the query IN NATURAL LANGUAGE MODE (which is the default in MySQL) that threw the error.




Theme © iAndrew 2016 - Forum software by © MyBB