c#中的位置类型(solr)
本文关键字:solr 置类型 位置 | 更新日期: 2023-09-27 18:04:42
我在solr schema.xml中有这个字段
<field name="geocode"
type="location"
indexed="true"
stored="true"
multiValued="false" />
我想知道,我需要什么类型的对象在我的c#类?
我正在尝试,但是solr抛出一个错误。
[SolrField("geocode")]
public System.Drawing.PointF GeoCode { get; set; }
SEVERE: java.lang.NumberFormatException: For input string: "{X=0"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Double.parseDouble(Unknown Source)
at org.apache.lucene.spatial.DistanceUtils.parsePointDouble(DistanceUtil
s.java:410)
有人能帮忙吗?
截至2012年10月,SolrNet提供了一个内置的Location类来支持地理空间搜索。我建议从GitHub上的SolrNet源代码或从夜间构建中获取最新版本,并使用这个类。
对于查询,SolrNet添加了SolrQueryByDistance
用于创建geofilt或bbox查询。