2017-03-11 4 views
0

Je viens d'installer Solr-6.4.2 et j'ai essayé d'installer la bibliothèque JTS like here explained en copiant tous les fichiers de bibliothèque JTS dans le répertoire /solr-6.4.2/server/solr-webapp/ WEB-INF/lib répertoire.Echec de l'installation de la bibliothèque jts sur Solr 6.4.2

ensuite configuré le schéma géré en ajoutant

<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType" 
      spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory" 
      distErrPct="0.025" 
      maxDistErr="0.000009" 
      units="degrees" 
     /> 

<field name="geo" type="location_rpt" indexed="true" stored="true" multiValued="true" /> 

et a commencé dans/bin avec ./solr départ (jetée)

Mais quand je visite l'interface solr il dit:

> org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: 
> Could not load conf for core polygon: Can't load schema 
> /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: 
> Plugin Initializing failure for [schema.xml] fieldType 

Il me semble que la bibliothèque n'est pas trouvée ou n'est pas chargée automatiquement (comme il se doit selon les tutoriels).

Pouvez-vous m'aider? Voici le fichier journal:

2017-03-11 15:44:57.061 INFO (main) [ ] o.a.s.c.CorePropertiesLocator Cores are: [polygon] 
2017-03-11 15:44:57.067 INFO (coreLoadExecutor-6-thread-1) [ x:polygon] o.a.s.c.SolrResourceLoader [null] Added 8 libs to classloader, from paths: [/home/spatial/solr-6.4.2/server/solr/polygon/lib] 
2017-03-11 15:44:57.117 INFO (main) [ ] o.e.j.s.Server Started @777ms 
2017-03-11 15:44:57.174 INFO (coreLoadExecutor-6-thread-1) [ x:polygon] o.a.s.c.SolrResourceLoader [polygon] Added 59 libs to classloader, from paths: [/home/spatial/solr-6.4.2/contrib/clustering/lib, /home/spatial/solr-6.4.2/contrib/extraction/lib, /home/spatial/solr-6.4.2/contrib/langid/lib, /home/spatial/solr-6.4.2/contrib/velocity/lib, /home/spatial/solr-6.4.2/dist] 
2017-03-11 15:44:57.209 INFO (coreLoadExecutor-6-thread-1) [ x:polygon] o.a.s.c.SolrConfig Using Lucene MatchVersion: 6.4.2 
2017-03-11 15:44:57.298 INFO (coreLoadExecutor-6-thread-1) [ x:polygon] o.a.s.s.IndexSchema [polygon] Schema name=example-data-driven-schema 
2017-03-11 15:44:57.385 WARN (coreLoadExecutor-6-thread-1) [ x:polygon] o.a.s.c.SolrResourceLoader Solr loaded a deprecated plugin/analysis class [solr.SynonymFilterFactory]. Please consult documentation how to replace it accordingly. 
2017-03-11 15:44:57.535 WARN (coreLoadExecutor-6-thread-1) [ x:polygon] o.a.s.s.AbstractSpatialFieldType Replace 'com.spatial4j.core' with 'org.locationtech.spatial4j' in your schema. 
2017-03-11 15:44:57.556 ERROR (coreLoadExecutor-6-thread-1) [ x:polygon] o.a.s.c.CoreContainer Error creating core [polygon]: Could not load conf for core polygon: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType 
org.apache.solr.common.SolrException: Could not load conf for core polygon: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType 
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:84) 
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:888) 
    at org.apache.solr.core.CoreContainer.lambda$load$3(CoreContainer.java:542) 
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:197) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:229) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: org.apache.solr.common.SolrException: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType 
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:598) 
    at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:183) 
    at org.apache.solr.schema.ManagedIndexSchema.<init>(ManagedIndexSchema.java:104) 
    at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:173) 
    at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:45) 
    at org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:75) 
    at org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:106) 
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:78) 
    ... 8 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:194) 
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:491) 
    ... 15 more 
Caused by: java.lang.RuntimeException: schema fieldtype location_rpt(org.apache.solr.schema.SpatialRecursivePrefixTreeFieldType) invalid arguments:{units=degrees} 
    at org.apache.solr.schema.FieldType.setArgs(FieldType.java:202) 
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:165) 
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:53) 
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:191) 
    ... 16 more 
2017-03-11 15:44:57.558 ERROR (coreContainerWorkExecutor-2-thread-1) [ ] o.a.s.c.CoreContainer Error waiting for SolrCore to be created 
java.util.concurrent.ExecutionException: org.apache.solr.common.SolrException: Unable to create core [polygon] 
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) 
    at java.util.concurrent.FutureTask.get(FutureTask.java:192) 
    at org.apache.solr.core.CoreContainer.lambda$load$4(CoreContainer.java:570) 
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:229) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: org.apache.solr.common.SolrException: Unable to create core [polygon] 
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:903) 
    at org.apache.solr.core.CoreContainer.lambda$load$3(CoreContainer.java:542) 
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:197) 
    ... 5 more 
Caused by: org.apache.solr.common.SolrException: Could not load conf for core polygon: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType 
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:84) 
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:888) 
    ... 7 more 
Caused by: org.apache.solr.common.SolrException: Can't load schema /home/spatial/solr-6.4.2/server/solr/polygon/conf/managed-schema: Plugin Initializing failure for [schema.xml] fieldType 
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:598) 
    at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:183) 
    at org.apache.solr.schema.ManagedIndexSchema.<init>(ManagedIndexSchema.java:104) 
    at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:173) 
    at org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:45) 
    at org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:75) 
    at org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:106) 
    at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:78) 
    ... 8 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:194) 
    at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:491) 
    ... 15 more 
Caused by: java.lang.RuntimeException: schema fieldtype location_rpt(org.apache.solr.schema.SpatialRecursivePrefixTreeFieldType) invalid arguments:{units=degrees} 
    at org.apache.solr.schema.FieldType.setArgs(FieldType.java:202) 
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:165) 
    at org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:53) 
    at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:191) 

Répondre

0

Il est apparu l'interface a été modifiée récemment et des exemples plus anciens trouvés sur stackoverflow, comme here ne fonctionnent pas avec la version la plus récente solr (6.4.2). La documentation la plus récente est here

Un exemple de configuration qui fonctionnera:

<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType" 
    spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory" 
    autoIndex="true" 
    distErrPct="0.025" 
    maxDistErr="0.001" 
    distanceUnits="kilometers" /> 

I. e. distanceUnits est maintenant utilisé à la place de units, etc. et degrees car l'attribut semble déclencher une erreur.

Le code initial que j'ai utilisé a généré des erreurs dans la version la plus récente de Solr.

Caused by: java.lang.RuntimeException: schema fieldtype location_rpt(org.apache.solr.schema.SpatialRecursivePrefixTreeFieldType) invalid arguments:{units=degrees}