我有一个Solr实例在我的Ubuntu机器上运行,使用Solr下载附带的默认Jetty服务器。Solr查询 - HTTP错误404未定义的字段文本
INFO: SolrDispatchFilter.init() done
Apr 12, 2012 2:01:56 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: undefined field text
正如我虽然说,服务器将:每当我使用
Java的罐子start.jar
服务器启动正常,但总是抛出的异常启动的Solr仍然开始,我可以看到Solr管理界面。我如下定义我的模式。
<fields>
<field name="id" type="string" indexed="true" stored="true" />
<field name="phraseID" type="int" indexed="true" stored="true" />
<field name="translation" type="string" indexed="true" stored="true" />
</fields>
<uniqueKey>id</uniqueKey>
我也能够执行JSON更新 - 我提交了一个被接受的数据样本数组。到目前为止,一切都很好。
当我试图运行一个查询:
http://localhost:8983/solr/select/?q=*:*&version=2.2&start=0&rows=10&indent=on
它正确地返回所有我在前面的样品提交的数据。
不过,我尝试使用文本查询的那一刻,我收到一个HTTP错误404
http://localhost:8983/solr/select/?q=fruit&version=2.2&start=0&rows=10&indent=on
--- returns ---
HTTP ERROR 400
Problem accessing /solr/select/. Reason:
undefined field text
Powered by Jetty://
问题是defaultSearchField - 它设置为“文本”,我与文本类型混淆。我将defaultSearchField设置为使用“翻译”(或任何您的字段名称),并且它完美地工作。 – 2012-04-12 19:40:18
在我的情况下,问题是''str name =“qf”>文字'而不是'内容 'in'solrconfig.xml'(“content”设置为'defaultSearchField' in 'schema.xml') –
daftu
2013-06-17 20:32:38
我一直在寻找这个答案几天,非常感谢,确实我不得不投票了这个awseome答案,但我想知道这是在文档中提到的。 – 2015-01-15 00:33:28