solr 空间索引的建立

[b]solr 空间索引的建立[/b]


配置:

修改 schema.xml :

1、添加空间索引字段类型
<!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
For more information about this and other Spatial fields new to Solr 4, see:
http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
-->
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
distErrPct="0.025"
maxDistErr="0.000009"
units="degrees"
geo="true"/>
2、 添加空间索引字段
<field name="LOCATION" type="location_rpt" indexed="true" stored="true" multiValued="true" />

3、数据准备:
文者是通过csv 文件进行导入,在文件中会有一个字段LOCATION,
数据格式为lng lat 例如:116.406174 39.920142
中间用空格隔开。


4、csv 文件的导入,并且创建索引。
http://localhost/solr-4.1.0/update/csv?stream.file=D:\tomcat7\0102.csv&stream.contentType=text/plain;charset=utf-8




http://localhost/solr-4.1.0/update/csv?commit=true
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值