我正在尝试从SOLR DB(代码中的查询查询)取回数据。 我可以直接在数据库中使用http访问数据。
这是我的查询:
http://.../select?indent=on&q=*:*&sfield=Geo&pt=45.15,14.85&sort=geodist()%20asc&fl=_dist_:geodist()&wt=json
var spatial = new LocalParams { { "type", "geofilt" }, { "pt", coordinates[0].ToString(CultureInfo.InvariantCulture) + "," + coordinates[1].ToString(CultureInfo.InvariantCulture) }, { "sfield", "Geo" }, { "d", distance } , { "sort", "geodist() asc" }, { "fl","_dist_:geodist()} + new SolrQuery("");
queryOptions.FilterQueries = new[] { spatial };
var datax = ops.Query(new SolrQuery($"-externalid:{sd.ID}"), queryOptions);
我希望输出如下:
"_dist_":0.09629470319718479}