The following instance methods seem to be missing from the Ferret::Document::Field class in Ferret 0.9.0 using compiled C extensions: #string_value, #reader_value and #binary_value. They are in the pure ruby implementation). I got round it by mixing in hacked versions of the pure Ruby methods (@data replaced by self.data). Many thanks for Ferret it''s shaping up to being a killer app for Ruby. -- Posted via http://www.ruby-forum.com/.
Hi Stuart, Just curious. What do you use those methods for? I didn''t bother including them because I didn''t think anyone would need them. It seemed simpler just to have the one method that returned the data as a string. I hope I can help. Cheers, Dave On 4/5/06, Stuart Rackham <srackham at methods.co.nz> wrote:> The following instance methods seem to be missing from the > Ferret::Document::Field class in Ferret 0.9.0 using compiled C > extensions: #string_value, #reader_value and #binary_value. They are in > the pure ruby implementation). > > I got round it by mixing in hacked versions of the pure Ruby methods > (@data replaced by self.data). > > Many thanks for Ferret it''s shaping up to being a killer app for Ruby. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >
David Balmain wrote:> Hi Stuart, > > Just curious. What do you use those methods for? I didn''t bother > including them because I didn''t think anyone would need them. It > seemed simpler just to have the one method that returned the data as a > string. I hope I can help.The #string_value is used in the Rails HowToIntegrateFerretWithRails demo application on the Rails Wiki http://wiki.rubyonrails.com/rails/pages/HowToIntegrateFerretWithRails It is used in the ./app/views/search/get_results.rhtml template for example: <strong><a href="<%= result.field(''url'').string_value %>"> I don''t know Lucene well enough to know wether there''s an alternative way of doing the the same thing. I''ve not come across any usage of the other two methods. Apologies for the time taken to reply, I''ve only just spotted your reply. Cheers, Stuart> > Cheers, > Dave-- Posted via http://www.ruby-forum.com/.
On 4/14/06, Stuart Rackham <srackham at methods.co.nz> wrote:> David Balmain wrote: > > Hi Stuart, > > > > Just curious. What do you use those methods for? I didn''t bother > > including them because I didn''t think anyone would need them. It > > seemed simpler just to have the one method that returned the data as a > > string. I hope I can help. > > The #string_value is used in the Rails HowToIntegrateFerretWithRails > demo application on the Rails Wiki > http://wiki.rubyonrails.com/rails/pages/HowToIntegrateFerretWithRails > > It is used in the ./app/views/search/get_results.rhtml template for > example: > > <strong><a href="<%= result.field(''url'').string_value %>"> > > I don''t know Lucene well enough to know wether there''s an alternative > way of doing the the same thing.All add the string_value method for backwards compatibility but you can just use the data method instead.> I''ve not come across any usage of the other two methods. > > Apologies for the time taken to reply, I''ve only just spotted your > reply.No worries, I took even longer to reply.> Cheers, Stuart > > > > > Cheers, > > Dave > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >