无法在Django项目中加载Solr核心的配置

时间:2017-09-28 13:29:31

标签: python xml django solr

我将$ python manage.py build_solr_schema的结果复制到examples/solr/blog/conf/schema.xml文件。我在我的Django动力项目中使用Apache Solr 4.10.4。当我运行Apache Solr时,我收到了错误:

SolrCore Initialization Failures

    blog: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core blog: Plugin Initializing failure for [schema.xml] fieldType. Schema file is solr/blog/conf/schema.xml 

Please check your logs for more information

Solr日志:

WARN  - 2017-09-28 15:15:40.335; org.apache.solr.schema.FieldTypePluginLoader; TokenFilterFactory is using deprecated 3.6.0 emulation. You should at some point declare and reindex to at least 4.0, because 3.x emulation is deprecated and will be removed in 5.0
WARN  - 2017-09-28 15:15:40.337; org.apache.solr.schema.FieldTypePluginLoader; TokenizerFactory is using deprecated 3.6.0 emulation. You should at some point declare and reindex to at least 4.0, because 3.x emulation is deprecated and will be removed in 5.0
WARN  - 2017-09-28 15:15:40.338; org.apache.solr.schema.FieldTypePluginLoader; TokenFilterFactory is using deprecated 3.6.0 emulation. You should at some point declare and reindex to at least 4.0, because 3.x emulation is deprecated and will be removed in 5.0
WARN  - 2017-09-28 15:15:40.338; org.apache.solr.schema.FieldTypePluginLoader; TokenFilterFactory is using deprecated 3.6.0 emulation. You should at some point declare and reindex to at least 4.0, because 3.x emulation is deprecated and will be removed in 5.0
WARN  - 2017-09-28 15:15:40.338; org.apache.solr.schema.FieldTypePluginLoader; TokenFilterFactory is using deprecated 3.6.0 emulation. You should at some point declare and reindex to at least 4.0, because 3.x emulation is deprecated and will be removed in 5.0
ERROR - 2017-09-28 15:15:40.339; org.apache.solr.core.CoreContainer; Error creating core [blog]: Could not load conf for core blog: Plugin Initializing failure for [schema.xml] fieldType. Schema file is solr/blog/conf/schema.xml
org.apache.solr.common.SolrException: Could not load conf for core blog: Plugin Initializing failure for [schema.xml] fieldType. Schema file is solr/blog/conf/schema.xml
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:66)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:489)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:466)
    at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:575)
    at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:199)
    at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:188)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
    at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:729)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:258)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:368)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
    at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.solr.common.SolrException: Plugin Initializing failure for [schema.xml] fieldType. Schema file is solr/blog/conf/schema.xml
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:595)
    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.ConfigSetService.createIndexSchema(ConfigSetService.java:90)
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:62)
    ... 34 more
Caused by: org.apache.solr.common.SolrException: Plugin Initializing failure for [schema.xml] fieldType
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:193)
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:486)
    ... 39 more
Caused by: org.apache.solr.common.SolrException: Must specify units="degrees" on field types with class SpatialRecursivePrefixTreeFieldType
    at org.apache.solr.schema.AbstractSpatialFieldType.init(AbstractSpatialFieldType.java:113)
    at org.apache.solr.schema.AbstractSpatialPrefixTreeFieldType.init(AbstractSpatialPrefixTreeFieldType.java:43)
    at org.apache.solr.schema.SpatialRecursivePrefixTreeFieldType.init(SpatialRecursivePrefixTreeFieldType.java:37)
    at org.apache.solr.schema.FieldType.setArgs(FieldType.java:166)
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:141)
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:43)
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:190)
    ... 40 more
ERROR - 2017-09-28 15:15:40.340; org.apache.solr.common.SolrException; org.apache.solr.common.SolrException: Error CREATEing SolrCore 'blog': Unable to create core [blog] Caused by: Must specify units="degrees" on field types with class SpatialRecursivePrefixTreeFieldType
    at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:613)
    at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:199)
    at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:188)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
    at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:729)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:258)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:368)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
    at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.solr.common.SolrException: Unable to create core [blog]
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:507)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:466)
    at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:575)
    ... 31 more
Caused by: org.apache.solr.common.SolrException: Could not load conf for core blog: Plugin Initializing failure for [schema.xml] fieldType. Schema file is solr/blog/conf/schema.xml
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:66)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:489)
    ... 33 more
Caused by: org.apache.solr.common.SolrException: Plugin Initializing failure for [schema.xml] fieldType. Schema file is solr/blog/conf/schema.xml
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:595)
    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.ConfigSetService.createIndexSchema(ConfigSetService.java:90)
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:62)
    ... 34 more
Caused by: org.apache.solr.common.SolrException: Plugin Initializing failure for [schema.xml] fieldType
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:193)
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:486)
    ... 39 more
Caused by: org.apache.solr.common.SolrException: Must specify units="degrees" on field types with class SpatialRecursivePrefixTreeFieldType
    at org.apache.solr.schema.AbstractSpatialFieldType.init(AbstractSpatialFieldType.java:113)
    at org.apache.solr.schema.AbstractSpatialPrefixTreeFieldType.init(AbstractSpatialPrefixTreeFieldType.java:43)
    at org.apache.solr.schema.SpatialRecursivePrefixTreeFieldType.init(SpatialRecursivePrefixTreeFieldType.java:37)
    at org.apache.solr.schema.FieldType.setArgs(FieldType.java:166)
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:141)
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:43)
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:190)
    ... 40 more

INFO  - 2017-09-28 15:15:40.342; org.apache.solr.servlet.SolrDispatchFilter; [admin] webapp=null path=/admin/cores params={schema=schema.xml&dataDir=data&name=blog&indexInfo=false&action=CREATE&collection=&shard=&wt=json&instanceDir=blog&config=solrconfig.xml&_=1506604540171} status=400 QTime=156 
INFO  - 2017-09-28 15:15:50.981; org.apache.solr.servlet.SolrDispatchFilter; [admin] webapp=null path=/admin/info/logging params={wt=json&since=0&_=1506604550952} status=0 QTime=2 
INFO  - 2017-09-28 15:15:51.850; org.apache.solr.servlet.SolrDispatchFilter; [admin] webapp=null path=/admin/cores params={wt=json&_=1506604551822} status=0 QTime=1 
INFO  - 2017-09-28 15:15:51.901; org.apache.solr.servlet.SolrDispatchFilter; [admin] webapp=null path=/admin/cores params={wt=json&_=1506604551883} status=0 QTime=0 
INFO  - 2017-09-28 15:22:03.559; org.eclipse.jetty.server.Server; Graceful shutdown SocketConnector@0.0.0.0:8983
INFO  - 2017-09-28 15:22:03.560; org.eclipse.jetty.server.Server; Graceful shutdown o.e.j.w.WebAppContext{/solr,file:/home/pecan/Downloads/solr-4.10.4/example/solr-webapp/webapp/},/home/pecan/Downloads/solr-4.10.4/example/webapps/solr.war
INFO  - 2017-09-28 15:22:04.566; org.apache.solr.core.CoreContainer; Shutting down CoreContainer instance=1006227006
INFO  - 2017-09-28 15:22:04.566; org.apache.solr.core.SolrCore; [collection1]  CLOSING SolrCore org.apache.solr.core.SolrCore@2d594e84
INFO  - 2017-09-28 15:22:04.566; org.apache.solr.update.DirectUpdateHandler2; closing DirectUpdateHandler2{commits=0,autocommit maxTime=15000ms,autocommits=0,soft autocommits=0,optimizes=0,rollbacks=0,expungeDeletes=0,docsPending=0,adds=0,deletesById=0,deletesByQuery=0,errors=0,cumulative_adds=0,cumulative_deletesById=0,cumulative_deletesByQuery=0,cumulative_errors=0,transaction_logs_total_size=0,transaction_logs_total_number=0}
INFO  - 2017-09-28 15:22:04.566; org.apache.solr.update.SolrCoreState; Closing SolrCoreState
INFO  - 2017-09-28 15:22:04.566; org.apache.solr.update.DefaultSolrCoreState; SolrCoreState ref count has reached 0 - closing IndexWriter
INFO  - 2017-09-28 15:22:04.567; org.apache.solr.update.DefaultSolrCoreState; closing IndexWriter with IndexWriterCloser
INFO  - 2017-09-28 15:22:04.576; org.apache.solr.core.SolrCore; [collection1] Closing main searcher on request.
INFO  - 2017-09-28 15:22:04.578; org.apache.solr.core.CachingDirectoryFactory; Closing NRTCachingDirectoryFactory - 2 directories currently being tracked
INFO  - 2017-09-28 15:22:04.578; org.apache.solr.core.CachingDirectoryFactory; looking to close /home/pecan/Downloads/solr-4.10.4/example/solr/collection1/data [CachedDir<<refCount=0;path=/home/pecan/Downloads/solr-4.10.4/example/solr/collection1/data;done=false>>]
INFO  - 2017-09-28 15:22:04.578; org.apache.solr.core.CachingDirectoryFactory; Closing directory: /home/pecan/Downloads/solr-4.10.4/example/solr/collection1/data
INFO  - 2017-09-28 15:22:04.579; org.apache.solr.core.CachingDirectoryFactory; looking to close /home/pecan/Downloads/solr-4.10.4/example/solr/collection1/data/index [CachedDir<<refCount=0;path=/home/pecan/Downloads/solr-4.10.4/example/solr/collection1/data/index;done=false>>]
INFO  - 2017-09-28 15:22:04.579; org.apache.solr.core.CachingDirectoryFactory; Closing directory: /home/pecan/Downloads/solr-4.10.4/example/solr/collection1/data/index
INFO  - 2017-09-28 15:22:04.581; org.eclipse.jetty.server.handler.ContextHandler; stopped o.e.j.w.WebAppContext{/solr,file:/home/pecan/Downloads/solr-4.10.4/example/solr-webapp/webapp/},/home/pecan/Downloads/solr-4.10.4/example/webapps/solr.war

我的Solr核心有以下参数:

  • 名称:博客
  • instanceDir :博客
  • dataDir :数据
  • config :solrconfig.xml
  • 架构:schema.xml

Solr core&#34; blog&#34;在Core Admin中不可见。

任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:0)

从架构中删除以下行

<dynamicField name="*_srpt"  type="location_rpt" indexed="true" stored="true"/>

<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
           geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />

或更改location_rpt的fieldType添加units="degrees"

<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
           geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" units="degrees"/>

答案 1 :(得分:0)

看起来你有另一个版本的Solr的模式文件。 在下面的修改之后,我能够使用schema.xml在4.10.4版本中创建Solr核心:

1-删除上面的行,如另一个回答中所述

<dynamicField name="*_srpt"  type="location_rpt" indexed="true" stored="true"/>

<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
           geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />

2-删除属性useDocValuesAsStored =&#34; false&#34;来自dynamicField&#34; * _ coordinate&#34;

3-将字段 version 的存储属性更改为已存储=&#34; true&#34;