Error with Ferret C Indexer
2006-Apr-22 01:12 UTC
[Ferret-talk] Ferret C Indexer Error: Fields not stored in index?
Hello, I am trying to get Ferret''s C indexer to work on OpenSUSE 10 and fastcgi. Indexing documents appears to work correctly but when I try to display the results I recieve the following error: ActionView::TemplateError (undefined method `string_value'' for stored/uncompressed,indexed,tokenized,<title:Revit.jpg>:Ferret::Document::Field) on line #17 of app/views/search/results.rhtml: 14: <%= render :partial => ''basic'' %> 15: <ul class="search"> 16: <% for result in @results 17: text = "<span class=''heading''>" + result.field(''title'').string_value + "</span><br/>" 18: text += "<span class=''subheading''>Posted by " + result.field(''created_by'').string_value + " at " + result.field(''created_on'').string_value + "</span> " 19: if !result.field(''body'').nil? 20: description = strip_tags(result.field(''body'').string_value) #{RAILS_ROOT}/app/views/search/results.rhtml:17:in `_run_rhtml_search_results'' #{RAILS_ROOT}/app/views/search/results.rhtml:16:in `each'' #{RAILS_ROOT}/app/views/search/results.rhtml:16:in `_run_rhtml_search_results'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:314:in `send'' It appears as if the indexer is not storing the actual field strings. Data for the index is being pulled from a MySQL database and then put into Ferret. If I delete the ferret_ext.so library file and rebuild the index using the pure Ruby indexer everything works perfectly so I am certain this is an issue with the C indexer. I have tried the gem file and compiling from source from svn (rev 325) and both produce the same error. Does anyone have any ideas? Regards, David -- Posted via http://www.ruby-forum.com/.
David Harrison
2006-Apr-22 02:13 UTC
[Ferret-talk] Ferret C Indexer Error: Fields not stored in index?
After a bit of experimenting and reflection I have found that when using the C indexer the function Field.data returns the value of the indexed field. Unfortunately using the pure Ruby indexer Field.data is not a function (its equivalent is Field.string_value). This is not too much of an issue though as I can do some presentation level reflection to call the correct function. There''s probably a better workaround than this but at least things are now working nice and quickly with the C indexer and fastcgi. Regards, David -- Posted via http://www.ruby-forum.com/.
David Balmain
2006-Apr-25 13:32 UTC
[Ferret-talk] Ferret C Indexer Error: Fields not stored in index?
Hi David, Please use Field#data from now on. data is actually an attribute of Field in the pure Ruby version so I''m not sure why it wasn''t working for you. ie, you shouldn''t need to do any reflection to access Field#data. Eventually I''ll probably remove the string_value and binary_value methods but they''ll stay for the moment. Sorry for the confusion. Cheers, Dave On 4/22/06, David Harrison <david.harrison at stress-free.co.nz> wrote:> After a bit of experimenting and reflection I have found that when using > the C indexer the function Field.data returns the value of the indexed > field. > Unfortunately using the pure Ruby indexer Field.data is not a function > (its equivalent is Field.string_value). > > This is not too much of an issue though as I can do some presentation > level reflection to call the correct function. > > There''s probably a better workaround than this but at least things are > now working nice and quickly with the C indexer and fastcgi. > > Regards, > > > David > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >