1.solr error logs org.apache.solr.common.SolrException: ERROR: [doc=17] unknown field aliashtml
在solr中 添加新的索引詞語時,報如標題所示錯誤,指定是插入的字段沒有在solr索引字段裏java
能夠修改 solr安裝目錄/solr/conf 目錄下的 schema.xml apache
在此xml文件內加入所需字段便可,格式以下 tomcat
<field name="alias" type="text_general" indexed="true" stored="true" />
注: name, type, indexed, stored 可根據實際狀況進行填寫! type 必須填寫schema.xml中fieldtype 定義的類型code
2. java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classpxml
若是遇到找不到"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\solrhtm
3.rg.apache.solr.common.SolrException: Error loading class 'solr.VelocityResponseWriterblog
<queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" enable="${solr.velocity.enabled:true}"/>
<!-- 把 enable="${solr.velocity.enabled:true}中的true修改成false -->索引