Hello,
I''ve been working on a specific project for longer than I like to
think about. At some point, I had ferret working in such a way that it
would search fields in the HABTM relationship. Now, though, it only
searches fields in the specific model where the search is located. The
application is structured like this:
Models:
providers
procedures
types
destinations
...
provider is where the search in question is located. Thus, it is at
http://localhost:3000/provider/search/. A provider
has_and_belongs_to_many procedures, types, and destinations. Thus,
when I search at the above URL, I want my search to take values that
correspond to those models, as well as the provider model.
provider.rb:
1. acts_as_ferret :additional_fields => [
2. :procedure_name,
3. :type_name,
4. :type_field,
5. :destination_name
6. ]
7. has_and_belongs_to_many :types, :join_table =>
"types_providers"
8. has_and_belongs_to_many :procedures, :join_table =>
"procedures_providers"
9. has_and_belongs_to_many :destinations, :join_table =>
"destinations_providers"
10.
11. def procedure_name
12. return "#{self.procedure.name}"
13. end
14.
15. def type_name
16. return "#{self.type.name}"
17. end
18.
19. def type_field
20. return "#{self.type.field}"
21. end
22.
23. def destination_name
24. return "#{self.destination.name}"
25. end
Thus, I defined the additional fields which I would like ferret to
index. It was doing this perfectly until recently, and I have tried
rebuilding the indexes of the above models and tried various other
small edits, but nothing has helped thus far.
Any ideas would be most appreciated. Thanks.
Jon
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
bump. On Feb 2, 10:41 pm, jonathan stegall <flamings...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I''ve been working on a specific project for longer than I like to > think about. At some point, I had ferret working in such a way that it > would search fields in the HABTM relationship. Now, though, it only > searches fields in the specific model where the search is located. The > application is structured like this: > > Models: > > providers > procedures > types > destinations > ... > > provider is where the search in question is located. Thus, it is athttp://localhost:3000/provider/search/. A provider > has_and_belongs_to_many procedures, types, and destinations. Thus, > when I search at the above URL, I want my search to take values that > correspond to those models, as well as the provider model. > > provider.rb: > > 1. acts_as_ferret :additional_fields => [ > 2. :procedure_name, > 3. :type_name, > 4. :type_field, > 5. :destination_name > 6. ] > 7. has_and_belongs_to_many :types, :join_table => > "types_providers" > 8. has_and_belongs_to_many :procedures, :join_table => > "procedures_providers" > 9. has_and_belongs_to_many :destinations, :join_table => > "destinations_providers" > 10. > 11. def procedure_name > 12. return "#{self.procedure.name}" > 13. end > 14. > 15. def type_name > 16. return "#{self.type.name}" > 17. end > 18. > 19. def type_field > 20. return "#{self.type.field}" > 21. end > 22. > 23. def destination_name > 24. return "#{self.destination.name}" > 25. end > > Thus, I defined the additional fields which I would like ferret to > index. It was doing this perfectly until recently, and I have tried > rebuilding the indexes of the above models and tried various other > small edits, but nothing has helped thus far. > > Any ideas would be most appreciated. Thanks. > Jon--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---