关于solr配置IK中文分词后报500错

HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure: [schema.xml] Duplicate field definition for 'name' [[[name{type=text_ik,properties=indexed,tokenized,stored}]]] and [[[name{type=text_general,properties=indexed,tokenized,stored}]]]. Schema file is F:\360Downloads\apache-tomcat-7.0.47\solr\home\collection1\schema.xml,trace=org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: [schema.xml] Duplicate field definition for 'name' [[[name{type=text_ik,properties=indexed,tokenized,stored}]]] and [[[name{type=text_general,properties=indexed,tokenized,stored}]]]. Schema file is F:\360Downloads\apache-tomcat-7.0.47\solr\home\collection1\schema.xml at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:783) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:295) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2430) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2419) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) Caused by: org.apache.solr.common.SolrException: [schema.xml] Duplicate field definition for 'name' [[[name{type=text_ik,properties=indexed,tokenized,stored}]]] and [[[name{type=text_general,properties=indexed,tokenized,stored}]]]. Schema file is F:\360Downloads\apache-tomcat-7.0.47\solr\home\collection1\schema.xml at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:608) at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:166) at org.apache.solr.schema.IndexSchemaFactory.create(IndexSchemaFactory.java:55) at org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:69) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:519) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:557) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:247) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:239) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) ... 3 more Caused by: org.apache.solr.common.SolrException: [schema.xml] Duplicate field definition for 'name' [[[name{type=text_ik,properties=indexed,tokenized,stored}]]] and [[[name{type=text_general,properties=indexed,tokenized,stored}]]] at org.apache.solr.schema.IndexSchema.loadFields(IndexSchema.java:664) at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:471) ... 15 more ,code=500}

解决思路:
1.将报错信息google可能找的到解决此方案的文章。找到不到执行
2.将报错信息拿到goolgle翻译。翻译后不难。发现F:\360Downloads\apache-tomcat-7.0.47\solr\home\collection1\schema.xml中field结点的name属性重名。
3.将schema.xml里的<field name="name" type="text_ik" indexed="true" stored="true"/>
改成<field name="xiao" type="text_ik" indexed="true" stored="true"/>
4.重起tomcat问题解决

你可能感兴趣的:(关于solr配置IK中文分词后报500错)