Hi Pat, I tried your proposal and it worked ;-) !! Thank you very much - but now I experience another problem: Model.search via ruby/script console works... but Model.search from a controller doesn't. Maybe a problem of a wrong thinking_sphinx version? Or do you have any clues how this issue is caused?
Best, Tom 2009/9/2 Pat Allan <[email protected]> > > Hi Tom > > attris.value in your Container's define_index block should work. I > don't think value is a reserved word, but just in case, try the > following: > indexes attris(:value), :as => :container_attribute > > -- > Pat > > On 02/09/2009, at 7:09 PM, Tom wrote: > > > > > Hi Pat, > > > > thank you for your response. I tried two different ways because my > > models (Container and Attri) are in a 1:N association. I wanted all > > container.attributes.values to be indexed but that didn't work, so > > I've tried the solution you can see in the Attri-Model below (and that > > didn't work either..). All my other Models get indexed as they are > > supposed to be, so I thought about reserved keywords, in this example > > "value". Here my models: > > > > > > class Attri < ActiveRecord::Base > > belongs_to :container > > > > define_index do > > indexes :value, :as => :attri_value > > set_property :delta => true > > end > > > > end > > > > > > class Container < ActiveRecord::Base > > has_many :attris, :dependent => :destroy > > > > define_index do > > indexes :name > > indexes attris.value, :as => :container_attribute #does this > > work? or should it be indexes container.attris.values, :as > > => :something ? > > set_property :delta => true > > end > > > > end > > > > > > Best regards, > > Tom > > > > > > On 2 Sep., 18:02, Pat Allan <[email protected]> wrote: > >> Hi Tom > >> > >> What's your define_index block looking like for this model? Are you > >> seeing any error messages (and if not, what's indicating that it's > >> not > >> working?) > >> > >> -- > >> Pat > >> > >> On 01/09/2009, at 1:40 PM, Tom wrote: > >> > >> > >> > >>> hi there, > >> > >>> i'm trying to five models. the whole thing works.. except for one > >>> model. it's name is "Attri" and has three values: "container_id", > >>> "key_id" and .. the value i want to index: "value". is "value" > >>> maybe a > >>> reserved keyword and is not recognized by ts? > >> > >>> thanks in advance, > >>> tom > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
