Reputation: 4519
I am trying to Implement a Solr-Spatial search for polygon , so I have added
spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
in the file schema.xml
of my core, but after adding this, when I restart my Tomcat, the core is not loaded, and if I don't add the above mentioned attribute it gives error "Polygon shape is undefined"
while searching(But the core is loaded )
From my error logs I am not able to understand what is wrong here, any help would be really appreciated.
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" />
Upvotes: 1
Views: 2934
Reputation: 6881
As noted here: https://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
you must download the JTS jar and put it in WEB-INF/lib in Solr's war file (or the location where that war file gets unpacked). Declaring it as a <lib>
does not work.
Upvotes: 2