0
votes

In rails 4.0.2, I am using sunspot solr as a search engine. Here, there is one text field which contains large text(data) with special characters.

While running a reindex command, I am getting an error like Backtrace: /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:283:in 'adapt_response'...

In model,

searchable do
  string   :cv_content
end

Using Gems are,

sunspot (2.1.1)
sunspot_rails (2.1.1)
sunspot_solr (2.1.1)

How can I solve reindex issue?

Full Error:

Backtrace: /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:283:inadapt_response' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:190:in execute' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:176:insend_and_receive' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/solr_instrumentation.rb:16:in block in send_and_receive_with_as_instrumentation' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activesupport-4.0.2/lib/active_support/notifications.rb:159:inblock in instrument' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activesupport-4.0.2/lib/active_support/notifications/instrumenter.rb:20:in instrument' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activesupport-4.0.2/lib/active_support/notifications.rb:159:ininstrument' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/solr_instrumentation.rb:15:in send_and_receive_with_as_instrumentation' (eval):2:inpost' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:82:in update' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:102:inadd'/home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:283:in adapt_response' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:190:inexecute' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:176:in send_and_receive' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/solr_instrumentation.rb:16:inblock in send_and_receive_with_as_instrumentation' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activesupport-4.0.2/lib/active_support/notifications.rb:159:in block in instrument' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activesupport-4.0.2/lib/active_support/notifications/instrumenter.rb:20:ininstrument' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activesupport-4.0.2/lib/active_support/notifications.rb:159:in instrument' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/solr_instrumentation.rb:15:insend_and_receive_with_as_instrumentation' (eval):2:in post' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:82:inupdate' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.10/lib/rsolr/client.rb:102:in add' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot-2.1.1/lib/sunspot/indexer.rb:107:inadd_documents' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot-2.1.1/lib/sunspot/indexer.rb:30:in add' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot-2.1.1/lib/sunspot/session.rb:91:inindex' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot-2.1.1/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in index' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot-2.1.1/lib/sunspot/session_proxy/retry_5xx_session_proxy.rb:17:inmethod_missing' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot-2.1.1/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in index' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot-2.1.1/lib/sunspot.rb:184:inindex' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/searchable.rb:257:in block (2 levels) in solr_index' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/searchable.rb:360:insolr_benchmark' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/searchable.rb:256:in block in solr_index' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/relation/batches.rb:75:infind_in_batches' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/activerecord-deprecated_finders-1.0.3/lib/active_record/deprecated_finders/relation.rb:70:in find_in_batches' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/searchable.rb:254:insolr_index' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/searchable.rb:203:in solr_reindex' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/tasks.rb:57:inblock (4 levels) in ' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot-2.1.1/lib/sunspot/class_set.rb:16:in each' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot-2.1.1/lib/sunspot/class_set.rb:16:ineach' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/tasks.rb:56:in block (3 levels) in <top (required)>' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/tasks.rb:68:inwith_session' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-2.1.1/lib/sunspot/rails/tasks.rb:19:in block (2 levels) in <top (required)>' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:240:incall' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:240:in block in execute' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:235:ineach' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:235:in execute' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain' /home/shruthi/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:172:ininvoke_with_call_chain' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:165:in invoke' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:150:ininvoke_task' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:in block (2 levels) in top_level' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:ineach' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:in block in top_level' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:115:inrun_with_threads' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:100:in top_level' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:78:inblock in run' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:176:in standard_exception_handling' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:75:inrun' /home/shruthi/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/bin/rake:33:in <top (required)>' /home/shruthi/.rvm/gems/ruby-2.1.2/bin/rake:23:inload' /home/shruthi/.rvm/gems/ruby-2.1.2/bin/rake:23:in <main>' /home/shruthi/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:ineval' /home/shruthi/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in <main>' Tasks: TOP => sunspot:reindex

1
Can we have the full error please? Will help in troubleshooting.Srikanth Venugopalan

1 Answers

0
votes

Recommended from ticket solr, sunspot, bad request, illegal character I created config/initializers/sunspot.rb with the suggested code and it did the trick.

Here's the issue mentioned in that ticket where the code was first suggested. https://github.com/sunspot/sunspot/issues/570