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

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

问题描述

我有一个 Solr 实例在我的 Ubuntu 机器上运行,使用 Solr 下载附带的默认 Jetty 服务器.每当我使用

启动 Solr<块引用>

java -jar start.jar

服务器启动正常,但总是抛出异常:

信息:SolrDispatchFilter.init() 完成2012 年 4 月 12 日下午 2:01:56 org.apache.solr.common.SolrException 日志严重:org.apache.solr.common.SolrException:未定义的字段文本

不过,正如我所说,服务器仍将启动,我可以看到 Solr 管理界面.我定义了我的架构如下.

<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--- 返回 ---HTTP 错误 400访问/solr/select/时出现问题.原因:未定义的字段文本由 Jetty 提供支持://

解决方案

默认 solr 配置定义了一些请求处理程序,其默认值与包含在 solr tarball 中的默认架构相匹配.

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

另外,检查您的 schema.xml,默认搜索字段未设置为 text,如下所示:<defaultSearchField>text</defaultSearchField>

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

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

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>

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.

When I attempt to run a query:

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.

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://

解决方案

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

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.

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天全站免登陆