我正在运行Solr 5.4(在Ubuntu服务器上)并从MySQL索引。它非常适合搜索和刻面,但现在我想实现地理空间过滤。在管理界面我跑,Solr geofilt返回所有结果
http://mysite:8983/solr/core/select?q=*%3A*&wt=json&indent=true&defType=edismax&spatial=true&pt=44.8859987%2C-93.0833396&sfield=org_loc&d=50
模式:
<field name="org_loc" type="location" indexed="true" stored="true"/>
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
响应:
{
"responseHeader":{
"status":0,
"QTime":13,
"params":{
"lowercaseOperators":"true",
"d":"50",
"spatial":"true",
"indent":"true",
"q":"*:*",
"sfield":"org_loc",
"pt":"44.8859987,-93.0833396",
"stopwords":"true",
"wt":"json",
"defType":"edismax"}},
"response":{"numFound":21,"start":0,"docs":[
"org_name": "..."
"org_loc":"44.8259987,-93.0813396",
...etc.
的问题是,它返回每次21的21条记录,不管d的。
可能是你只有21条记录与匹配标准是什么?你检查过其他输入吗? –
该数据库拥有21个用于测试的虚假数据的总记录。无论pt或d如何,它都会返回全部21条记录。 – SM0827
d是径向距离,通常以公里为单位,请将此值增加到100并测试一次 –