Also, I find it interesting that you refer to 'users' *and* 'user' in your fields - do you have two associations? Or is one of them a typo?
-- Pat On 10/03/2010, at 4:00 PM, Greg DeVore wrote: > I am guessing that name is not an actual table in your database but a > method that concats first_name and last_name. TS can't index ruby > methods, only mysql tables. That is probably why you are getting your > error. > > Greg DeVore > > On Mar 8, 10:45 am, Ash <[email protected]> wrote: >> Hello, >> I am still new to RoR and finding it hard to grasp a problem I am >> having with indexing. >> >> My basic search functionality works great, but when I was trying to >> implement searching that has many table associations I am receiving >> errors while indexing. I don't think I am using the correct syntax for >> the search... >> >> So in my app a ticket belongs_to a user. So in a view, >> ticket.user.name can be called and return a string of the Users >> Fullname, I want this indexed... >> >> I have tried the following with no luck in my ticket model. *Where the >> asterix is what gives me an issue.. >> >> define_index do >> indexes :body >> indexes :title >> indexes users(:user_id), :as => :userid >> indexes user.name, :as => :name (**** my issue) >> has :updated_at >> end >> >> ERROR: index 'ticket_core': sql_range_query: 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 'AS `name`, `tickets`.`id` AS >> `sphinx_internal_id` >> >> I have also tried this syntax; >> >> indexes user(:name), :as => :name >> >> and the same error persists.. >> >> Any help would be awesome and appreciated. >> >> Ash :) > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en. > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
