Ошибка при переиндексации в Solr — RSolr::Error::Http: RSolr::Error::Http — 400 Bad Request — неопределенный тип поля

Я установил Solr 4.4 на сервер Ubuntu с Tomcat 6 по этой ссылке - http://www.arborisoft.com/how-to-install-apache-solr-4-4-on-ubuntu-12-04/.

Модель Activity индексируется с помощью Solr (проект Ruby on Rails). При переиндексации получаю ошибку:

RSolr::Error::Http: RSolr::Error::Http - 400 Bad Request
Error: {'responseHeader'=>{'status'=>400,'QTime'=>59},'error'=>{'msg'=>'undefined field type','code'=>400}}

URI: http://localhost:8080/solr/update?wt=ruby
Request Headers: {"Content-Type"=>"text/xml"}
Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><delete><query>type:Activity</query></delete>"

Backtrace: /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:284:in `adapt_response'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:190:in `execute'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:176:in `send_and_receive'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sunspot_rails-2.2.0/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `instrument'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sunspot_rails-2.2.0/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:82:in `update'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rsolr-1.0.12/lib/rsolr/client.rb:146:in `delete_by_query'(eval):2:in `post'
Tasks: TOP => sunspot:solr:reindex => sunspot:reindex
(See full trace by running task with --trace)

солнечное пятно.yml

staging:
  solr:
    hostname: localhost
    port: 8080
    log_level: WARNING
    path: /solr/

person Simmi Badhan    schedule 03.09.2015    source источник
comment
проверьте, есть ли у вас файлы конфигурации в папке conf...schema.xml и solrconfig.xml...svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/solr/   -  person Abhijit Bashetti    schedule 03.09.2015
comment
conf находятся в каталоге /opt/solr/collection1/conf/, как указано в этом руководстве — arborisoft.com/how-to-install-apache-solr-4-4-on-ubuntu-12-04   -  person Simmi Badhan    schedule 03.09.2015
comment
у вас есть файл sunspot.yml?   -  person Abhijit Bashetti    schedule 03.09.2015
comment
Это как-то связано с версией solr? Он работает с моим локальным сервером. Там у меня настроен Solr 4.1. Я настроил промежуточный сервер с solr 4.4.   -  person Simmi Badhan    schedule 03.09.2015
comment
вы не указали имя коллекции в sunspot.yml по пути: /solr/collection_name   -  person Abhijit Bashetti    schedule 03.09.2015
comment
Попытался добавить имя коллекции в sunspot.yml. Выдает ту же ошибку.   -  person Simmi Badhan    schedule 03.09.2015
comment
Вы можете вставить изменение здесь   -  person Abhijit Bashetti    schedule 03.09.2015
comment
Спасибо, но изменение sunspot.yml не помогает. Если бы sunspot.yml был неправильным, сервер solr не запустился бы. (Поверьте мне, я потратил много времени на правильную настройку). Проблема здесь, похоже, связана с версией solr. Кажется, Solr 4.4 не поддерживает некоторые типы данных.   -  person Simmi Badhan    schedule 03.09.2015
comment
откройте файл schema.xml и проверьте, определен ли там тип поля "msg"...   -  person Abhijit Bashetti    schedule 03.09.2015


Ответы (1)


Теперь я могу переиндексировать. В schema.xml отсутствовала эта строка:

<field name="type" stored="false" type="string" multiValued="true" indexed="true"/>
person Simmi Badhan    schedule 03.09.2015