Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Solr geofilt返回所有结果_Solr - Fatal编程技术网

Solr geofilt返回所有结果

Solr geofilt返回所有结果,solr,Solr,我正在运行Solr5.4(在Ubuntu服务器上)并从MySQL编制索引。它对于搜索和刻面非常有用,但现在我想实现地理空间过滤。在我运行的管理UI中 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 模式:

我正在运行Solr5.4(在Ubuntu服务器上)并从MySQL编制索引。它对于搜索和刻面非常有用,但现在我想实现地理空间过滤。在我运行的管理UI中

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"/>

问题是它每次返回21条记录中的21条,与d无关。

geofilt
必须使用
fq
参数明确要求,查询的这一部分缺失:

&fq={!geofilt}

您可能只有21条符合条件的记录?您是否检查了其他输入?db共有21条记录,其中包含用于测试的虚假数据。它返回所有21条记录,不管pt或d。d是径向距离,通常以公里为单位,请将此值增加到100,然后测试一次。没有问题,对吗?我说的是不管d。我试过5,50,500,5000。它每次返回21条记录,无论返回的记录落在半径内还是半径外。这很有效!我以前试过很多次geofilt,甚至直接从手册中粘贴了这一行:&q=*:*&fq={!geofilt sfield=org_loc}&pt=44.8859987,-93.0833396&d=50,但它不起作用。奇怪的是,当我在admin UI的fq参数中输入{!geofilt}时,它确实起作用,该参数会生成以下内容:&fq={!geofilt}&spatial=true&pt=44.8659987%2C-93.0823396&sfield=org_loc&d=500(加上其他相关参数)。谢谢你给我指明了正确的方向!
&fq={!geofilt}