Welcome Guest, Not a member yet? Register   Sign In
full text search with active records?
#11

[eluser]Unknown[/eluser]
Did I understand correctly that this is fixed in the current SVN-version?

Thanks a lot.
#12

[eluser]Peter O'Sullivan[/eluser]
I have two text columns tags and body , both with FULLTEXT, a table called lines. Can any tell me why this does not work?

Code:
$this->db->where('MATCH (lines.body, lines.tags) AGAINST ("'. $str_search .'")', NULL, FALSE);
$this->db->group_by("lines.id");
$query = $this->db->get('lines');

Error Number: 1191

Can't find FULLTEXT index matching the column list

SELECT * FROM (`lines`) WHERE MATCH (lines.body, lines.tags) AGAINST ("good habits formed at ") OR MATCH (author) AGAINST ("good habits formed at " WITH QUERY EXPANSION) GROUP BY `lines`.`id`


But when I seperate the match into two where's, it works....

Code:
$this->db->where('MATCH (lines.tags) AGAINST ("'. $str_search .'")', NULL, FALSE);
$this->db->or_where('MATCH (lines.body) AGAINST ("'. $str_search .'")', NULL, FALSE);
$this->db->group_by("lines.id");
$query = $this->db->get('lines');
#13

[eluser]TheFuzzy0ne[/eluser]
The fulltext index must go across the two columns, and not be set individually on each.

Hope this helps.
#14

[eluser]Peter O'Sullivan[/eluser]
Yes, thanks. SOLVED

Needed to add an INDEX with both fields in it.

Code:
ALTER TABLE `lines` ADD FULLTEXT (`body` ,`tags`)




Theme © iAndrew 2016 - Forum software by © MyBB