solrcloud使用问题记录
Solr Ping query caused exception: undefined field text
-
<span style="font-weight: normal;"><span style="font-size:18px;">如果发现这个异常,修改solrconfig.xml:
-
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
-
<lst name="invariants">
-
<str name="q">solrpingquery</str>
-
</lst>
-
<lst name="defaults">
-
<str name="qt">standard</str>
-
<str name="echoParams">all</str>
-
<str name="df">text</str>
-
</lst>
-
</requestHandler>
-
这个配置中的(<str name="df">text</str>)text域为自己定义的域,如果没有这个添加一个</span></span>
- <span style="font-weight: normal;"><span style="font-size:18px;">如果发现这个异常,修改solrconfig.xml:
- <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
- <lst name="invariants">
- <str name="q">solrpingquery</str>
- </lst>
- <lst name="defaults">
- <str name="qt">standard</str>
- <str name="echoParams">all</str>
- <str name="df">text</str>
- </lst>
- </requestHandler>
- 这个配置中的(<str name="df">text</str>)text域为自己定义的域,如果没有这个添加一个</span></span>
在schema.xml 定义中不存在text field ,在启动solr 时会出现下面的异常:
org.apache.solr.common.SolrException: undefined field text
-
<span style="font-weight: normal;"><span style="font-size:18px;">解决办法:
-
编辑solrconfig.xml
-
<listener event="firstSearcher" class="solr.QuerySenderListener">
-
<arr name="queries">
-
<lst>
-
<str name="q">static firstSearcher warming in solrconfig.xml</str>
-
</lst>
-
</arr>
-
</listener>
-
修改为以下内容
-
<listener event="firstSearcher" class="solr.QuerySenderListener">
-
<arr name="queries">
-
<lst>
-
<str name="q">*:*</str>
-
</lst>
-
</arr>
-
</listener></span></span>
- <span style="font-weight: normal;"><span style="font-size:18px;">解决办法:
- 编辑solrconfig.xml
- <listener event="firstSearcher" class="solr.QuerySenderListener">
- <arr name="queries">
- <lst>
- <str name="q">static firstSearcher warming in solrconfig.xml</str>
- </lst>
- </arr>
- </listener>
- 修改为以下内容
- <listener event="firstSearcher" class="solr.QuerySenderListener">
- <arr name="queries">
- <lst>
- <str name="q">*:*</str>
- </lst>
- </arr>
-
</listener></span></span>