【发布时间】:2014-06-16 00:30:21
【问题描述】:
我正在将太阳黑子搜索引入我的项目。我只通过名称字段搜索就获得了 POC。当我引入描述字段并重新索引已售出时,我收到以下错误。
** Invoke sunspot:reindex (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute sunspot:reindex
Skipping progress bar: for progress reporting, add gem 'progress_bar' to your Gemfile
rake aborted!
RSolr::Error::Http: RSolr::Error::Http - 400 Bad Request
Error: {'responseHeader'=>{'status'=>400,'QTime'=>18},'error'=>{'msg'=>'Illegal character ((CTRL-CHAR, code 11))
at [row,col {unknown-source}]: [42,1]','code'=>400}}
Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><add><doc><field name=\"id\">ItemsDesign 1322</field><field name=\"type\">ItemsDesign</field><field name=\"type\">ActiveRecord::Base</field><field name=\"class_name\">ItemsDesign</field><field name=\"name_text\">River City Clocks Musical Multi-Colored Quartz Cuckoo Clock</field><field name=\"description_text\">This colorful chalet style German quartz cuckoo clock accurately keeps time and plays 12 different melodies. Many colorful flowers are painted on the clock case and figures of a Saint Bernard and Alpine horn player are on each side of the clock dial. Two decorative pine cone weights are suspended beneath the clock case by two chains. The heart shaped pendulum continously swings back and forth. On every
我假设坏字符是 你可以在底部看到。那 散布在很多描述中。我什至不确定那是什么字符。
我可以做些什么来让 solr 忽略它或清理数据以便售出可以处理它。
谢谢
【问题讨论】:
-
你愿意接受我的回答吗?或者我还能做些什么来更好地回答你的问题?我遇到了同样的问题,我的回答帮助了我。希望它也对您有所帮助。
标签: ruby-on-rails search solr sunspot