我正在尝试实现多边形的Solr-Spatial搜索,所以我添加了
spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
在我的核心文件 schema.xml
中,但在添加此内容后,当我重新启动Tomcat时,核心未加载,如果我不添加以上内容提到的属性在搜索时会给出错误 "Polygon shape is undefined"
(但核心已加载)
从我的错误日志中我无法理解这里有什么问题,任何帮助都会非常感激。
solr.log
2015-04-16T21:16:02,526 - INFO [qtp27984006-16:SolrResourceLoader@228] - Adding 'file:/opt/lucidworks/fusion/solr/dih/jts-1.8.0.jar' to classloader
2015-04-16T21:16:02,526 - INFO [qtp27984006-16:SolrResourceLoader@228] - Adding 'file:/opt/lucidworks/fusion/solr/dih/spatial4j-0.4.1.jar' to classloader
2015-04-16T21:16:02,526 - INFO [qtp27984006-16:SolrResourceLoader@228] - Adding 'file:/opt/lucidworks/fusion/solr/dih/solr-dataimporthandler-extras-4.10.1.jar' to classloader
2015-04-16T21:16:02,527 - INFO [qtp27984006-16:SolrResourceLoader@228] - Adding 'file:/opt/lucidworks/fusion/solr/dih/mysql-connector-java.jar' to classloader
2015-04-16T21:16:02,527 - INFO [qtp27984006-16:SolrResourceLoader@228] - Adding 'file:/opt/lucidworks/fusion/solr/dih/solr-dataimporthandler-4.10.1.jar' to classloader
2015-04-16T21:16:02,551 - INFO [qtp27984006-16:SolrIndexConfig@162] - IndexWriter infoStream solr logging is enabled
2015-04-16T21:16:02,554 - INFO [qtp27984006-16:SolrConfig@198] - Using Lucene MatchVersion: 4.10.3
2015-04-16T21:16:02,599 - INFO [qtp27984006-16:SolrConfig@317] - Loaded SolrConfig: solrconfig.xml
2015-04-16T21:16:02,603 - INFO [qtp27984006-16:IndexSchema@440] - Reading Solr Schema from /configs/myconf/schema.xml
2015-04-16T21:16:02,654 - INFO [qtp27984006-16:IndexSchema@468] - [collection1] Schema name=example
2015-04-16T21:16:02,930 - ERROR [qtp27984006-16:SolrException@142] - null:java.lang.NoClassDefFoundError: com/vividsolutions/jts/geom/CoordinateSequenceFactory
schema.xml
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType" spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory "distErrPct="0.025" maxDistErr="0.000009" />
答案 0 :(得分:1)
如上所述:https://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
你必须下载JTS jar并将它放在Solr的war文件中的WEB-INF / lib中(或者解压该war文件的位置)。将其声明为<lib>
不起作用。