Currently my search is doing this, and works fine -
@results = item.paginate(:all, :conditions => [ "match(tags.name,
#{conditions}) against (? in boolean mode)", @search_term ], :include =>
:tags, :order => "#{order} ASC", :page => params[:page])
However, i want to use WITH QUERY EXPANSION, which returns an expanded
search, ie returning any items which have words matching the original
search. I thought that this should work
@results = item.paginate(:all, :conditions => [ "match(tags.name,
#{conditions}) against (? in boolean mode WITH QUERY EXPANSION)",
@search_term ], :include => :tags, :order => "#{order} ASC",
:page =>
params[:page])
but it''s crashing with this error -
Mysql::Error: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near ''WITH QUERY EXPANSION))'' at line 1: SELECT
count(DISTINCT
learningpaths.id) AS count_all FROM learningpaths LEFT OUTER JOIN
taggings ON (learningpaths.`id` = taggings.`taggable_id` AND
taggings.`taggable_type` = ''Learningpath'') LEFT OUTER JOIN
tags ON
(tags.`id` = taggings.`tag_id`) WHERE (match(tags.name,
learningpaths.name, learningpaths.description) against (''+trumpet
+beginners'' in boolean mode WITH QUERY EXPANSION))
Looking at the mysql search it tried to do, it looks fine to me - can
anyone see a problem with how "with query expansion" is being used?
thanks
max
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---