本文介绍了用solr异常索引多边形(找不到jts?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在设置solr 4.10.2来处理多边形时遇到麻烦.我尝试使示例应用程序适应于类型为location_rpt的名为geom的字段.我将jts-1.13.jar添加到目录中的文件solr-4.10.2/example/webapps/solr.warWEB-INF/lib,我在schema.xml中创建了一个字段:

I'm having trouble setting up solr 4.10.2 to work with polygons. I try to adapt the example application to work with an field called geom with the type location_rpt. I added jts-1.13.jar to the file solr-4.10.2/example/webapps/solr.war in the directory WEB-INF/lib and I created a field in schema.xml:

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

我从java -jar start.jar开始solr.

但是当我尝试添加带有geom字段的文档时,出现异常:

But when I try to add a document with a geom field I get an exception:

Caused by: java.text.ParseException: Unknown Shape definition [POLYGON ((12.833040666607534 54.00218401664526, 12.83303934146181 54.10218449095831, 12.999714402162988 54.10218524894654, 12...]
at com.spatial4j.core.io.WktShapeParser.parse(WktShapeParser.java:90)
at com.spatial4j.core.context.SpatialContext.readShapeFromWkt(SpatialContext.java:294)

似乎无法识别jts jar.我必须在某个地方进行配置吗?

It seems that the jts jar is not recognized. Do I have to configure it somewhere?

致谢

丹尼尔

推荐答案

我找到了它:字段定义需要属性 spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory" 或系统属性SpatialContextFactory必须设置为com.spatial4j.core.context.jts.JtsSpatialContextFactory.

I found it: the field definition needs the attribute spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory" or the system property SpatialContextFactory must be set to com.spatial4j.core.context.jts.JtsSpatialContextFactory.

这篇关于用solr异常索引多边形(找不到jts?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 02:02