Hi there, I''m using acts_as_ferret, and I''d like to search by ID. Apparently aaf automatically adds id to the search index, and I noticed that if you try to manually add it you get an error, but if I search by ID it doesn''t find anything... Does anyone know how to tell aaf that I want to search by id as well? I can''t find it in the docs anywhere... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hi jonzo! Jonzo [2008-03-07 03:05]:> I''m using acts_as_ferret, and I''d like to search by ID. > Apparently aaf automatically adds id to the search index, and I > noticed that if you try to manually add it you get an error, but > if I search by ID it doesn''t find anything... Does anyone know > how to tell aaf that I want to search by id as well? I can''t find > it in the docs anywhere...worksforme: find_with_ferret(''id:<your-id-here>'') note that ID isn''t part of the default field list, so you have to specify it explicitly. OTOH, are you sure you''re searching for an ID that''s actually present in the index? hth jens -- Jens Wille, Dipl.-Bibl. (FH) prometheus - Das verteilte digitale Bildarchiv für Forschung & Lehre Kunsthistorisches Institut der Universität zu Köln Albertus-Magnus-Platz, D-50923 Köln Tel.: +49 (0)221 470-6668, E-Mail: jens.wille-31N1O1AsgN5n68oJJulU0Q@public.gmane.org http://www.prometheus-bildarchiv.de/ --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hi jonzo! Hi! :-)> worksforme: > > find_with_ferret(''id:<your-id-here>'') > > note that ID isn''t part of the default field list, so you have to > specify it explicitly.Is there any way I can make it part of the default field list? I don''t want to start screwing with peoples queries, I started doing that a while ago and ended up adding lots of stuff to make ferret behave how I thought I wanted it to behave... but it ends up getting really confusing so I reverted back to basics (not touching the query, then manipulating the results afterwards) OTOH, are you sure you''re searching for an ID> that''s actually present in the index?Yeah :-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jonathan Fantham [2008-03-07 20:46]:> Is there any way I can make it part of the default field list?well, you can add it in your acts_as_ferret call (untested): acts_as_ferret <your-options>, :ferret => { :default_field => <array-of-fields-incl-id> } see the documentation at [1]. but please notice the warning about including untokenized fields in the default_field list, since :id *is* untokenized. [1] <http://projects.jkraemer.net/rdoc/acts_as_ferret/classes/ActsAsFerret/ActMethods.html#M000009> cheers jens --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---