solr 常见异常

1.solr error logs org.apache.solr.common.SolrException: ERROR: [doc=17] unknown field alias

    在solr中 添加新的索引词语时,报如标题所示错误,指定是插入的字段没有在solr索引字段里

    可以修改 solr安装目录/solr/conf 目录下的 schema.xml 

    在此xml文件内加入所需字段即可,格式如下 

  

 <field name="alias" type="text_general" indexed="true" stored="true" />

    注: name, type, indexed, stored 可根据实际情况进行填写! type 必须填写schema.xml中fieldtype 定义的类型

2. java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classp

    如果遇到找不到"solrconfig.xml"文件的错误,设置solr.solr.home环境变量:在D:\apache-tomcat-6.0.35\bin\catalina.bat文件(非windons,修改catalina.sh文件)第一行加入                set JAVA_OPTS=%JAVA_OPTS% -Dsolr.solr.home=D:\apache-tomcat-6.0.35\solr

3.rg.apache.solr.common.SolrException: Error loading class 'solr.VelocityResponseWriter

    

  

 <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" enable="${solr.velocity.enabled:true}"/>

    <!-- 把 enable="${solr.velocity.enabled:true}中的true修改为false -->

猜你喜欢

转载自my.oschina.net/u/218567/blog/1615230
今日推荐