2016-09-28 53 views
0

我正在使用Solr版本6.2.1並嘗試返回給定經度和緯度的最近位置。Solr空間搜索不返回響應元素中的任何結果

我已經設法將數據添加到Solr並對其進行索引。

我的數據文件(.csv)的格式如下:

id,areaname,geo,country,state 
1125257,"Mumbai","18.9750,72.8258","India","Maharashtra" 
1125258,"Mumgaon","26.3833,93.4833","India","Assam" 
1125259,"Mummasar","28.2167,74.2833","India","Rajasthan" 
1125260,"Mummidivaram","16.6500,82.1167","India","Andhra Pradesh" 
1125261,"Munaba","25.7500,70.2833","India","Rajasthan" 
1125262,"Munabao","25.7500,70.2833","India","Rajasthan" 
1125263,"Munabo","25.7500,70.2833","India","Rajasthan" 
1125264,"Munagala","17.0500,79.8333","India","Andhra Pradesh" 

在託管模式文件以下字段的設置:

<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/> 

和現場地質爲:

<field name="geo" type="location" indexed="true" stored="true" /> 
<field name="geo_0_coordinate" type="tdouble" indexed="true" stored="false" /> 
<field name="geo_1_coordinate" type="tdouble" indexed="true" stored="false" /> 

現在,當我運行我的查詢來查找最近的位置時,它在響應元素中沒有返回任何內容。

{!geofilt sfield=geo}&pt=28.2167,74.2833&d=100 

在日誌和數據中沒有錯誤編入索引。

請有人能解釋我爲什麼這是行不通的。

謝謝。

回答

0

Solr將solr.LatLonType替換爲solr.LatLonPointSpatialField 我剛剛使用LatLonPointSpatialField來解決此問題。 Tow領域_coordinate是沒有必要的。

+0

https://issues.apache.org/jira/browse/SOLR-10238在7.0中刪除LatLonType;由LatLonPointSpatialField取代 –