Solr查询-HTTP错误404未定义字段文本 [英] Solr Query - HTTP error 404 undefined field text

查看:207
本文介绍了Solr查询-HTTP错误404未定义字段文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Solr下载随附的默认Jetty服务器在Ubuntu计算机上运行了Solr实例.每当我使用

I've got a Solr instance running on my Ubuntu machine using the default Jetty server that the Solr download comes with. Whenever I start Solr using

java -jar start.jar

java -jar start.jar

服务器启动正常,但始终会引发异常:

The server starts fine but there is always an exception thrown:

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

如我所说,服务器仍将启动,并且可以看到Solr管理界面.我将架构定义如下.

As I said though, the server will still start and I can see the Solr admin interface. I defined my schema as follows.

<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更新-我提交了一个被接受的示例数据数组.到目前为止,一切都很好.

I was also able to perform a JSON update - I submitted a sample array of data that was accepted. Up to this point everything is fine.

当我尝试运行查询时:

http://localhost:8983/solr/select/?q=*:*&version=2.2&start=0&rows=10&indent=on

它会正确返回我先前在示例中提交的所有数据.

It correctly returns all the data that I submitted in my sample earlier.

但是,当我尝试使用文本进行查询时,会收到HTTP错误404.

However, the moment I try to query using text, I receive an HTTP ERROR 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://

推荐答案

默认solr配置定义了一些请求处理程序,这些请求处理程序的默认值与solr tarball中包含的默认模式匹配.

Default solr configuration has defined some request handlers with defaults that match the default schema included in the solr tarball.

检查在solrconfig中定义的请求处理程序,您可能会发现 <str name="qf">和其他配置值包括一些您尚未在架构中定义的字段.

Check the request handlers defined in solrconfig and you might find that <str name="qf"> and other configuration values include some fields you haven't defined in the schema.

还要检查您的schema.xml,以确保默认搜索字段未设置为 text ,例如:<defaultSearchField>text</defaultSearchField>

Also, check your schema.xml, that the default search field isn't set to text like this: <defaultSearchField>text</defaultSearchField>

这篇关于Solr查询-HTTP错误404未定义字段文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆