有没有办法将MATCH
andAGAINST
部分转换为Arel?
我在 Arel 源代码中找不到任何关于它的信息。
我正在使用 Rails 3。
SELECT gigs.time, gigs.channel_id, gigs.song_id, gigs.id,
MATCH (songs.title) AGAINST (?) AS song_score,
MATCH (artists.name) AGAINST (?) AS artist_score
FROM songs
INNER JOIN artists ON artists.id = songs.artist_id
INNER JOIN gigs ON gigs.song_id = songs.id
WHERE MATCH (artists.name) AGAINST (?) OR
MATCH (songs.title) AGAINST (?)
HAVING (artist_score + song_score) > 0