首页 文章

如何配置solr4.10进行多边形的地理空间搜索

提问于
浏览
0

嗨我想配置solr4.10进行多边形的空间搜索,我已经做了以下更改在schema.xml中我做了如下更改

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

Actualy这个条目已经存在但不包含spatialContextFactory所以也添加了这个 .

现在我插入的文件如下

<add>
<doc>
  <field name="id">3007</field>
  <field name="name">Autauga</field>
  <field name="coordinate">POLYGON((-10 30,-40 40,-10 -20,40 20,0 0,-10 30))</field>
</doc>
</add>

但是当我尝试使用post.jar插入文档时,它会给出异常,如下所示

SimplePostTool version 1.5
Posting files to base url http://localhost:8983/solr/update using content-type application/xml..
POSTing file counties1.xml
SimplePostTool: WARNING: Solr returned an error #404 (Not Found) for url: http://localhost:8983/solr/update
SimplePostTool: WARNING: Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/update. Reason:
<pre>    Not Found</pre></p><hr /><i><small>Powered by Jetty://</small></i>



















</body> </html> SimplePostTool: WARNING: IOException while reading response: java.io.FileNotFoundException: http://localhost:8983/solr/update 1 files indexed. COMMITting Solr index changes to http://localhost:8983/solr/update.. SimplePostTool: WARNING: Solr returned an error #404 (Not Found) for url: http://localhost:8983/solr/update?commit=true SimplePostTool: WARNING: Response: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> <title>Error 404 Not Found</title> </head> <body><h2>HTTP ERROR 404</h2> <p>Problem accessing /solr/update. Reason: <pre> Not Found</pre></p><hr /><i><small>Powered by Jetty://</small></i>



















</body> </html> Time spent: 0:00:00.017

请让我知道我错在哪里

1 回答

  • 0

    只需将jts-1.13放在solr-4.10.1 / example / solr-webapp / webapp / WEB-INF / lib目录下,现在数据将索引正常

相关问题