【问题标题】:location type(solr) in C#C# 中的位置类型(solr)
【发布时间】:2013-03-18 14:34:18
【问题描述】:

我的 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)

谁能帮忙?

【问题讨论】:

标签: c# .net solr lucene solrnet


【解决方案1】:

截至 2012 年 10 月,SolrNet 带有一个内置的 Location 类,用于支持地理空间搜索。我建议从源代码 - SolrNet on GitHubnightly builds 获取最新版本并使用此类。

对于查询,SolrNet 添加了 SolrQueryByDistance 用于创建 geofilt 或 bbox 查询。请参阅SolrNet - Querying 了解更多详情。

【讨论】:

  • 大家好,我终于做到了。我无法更新 dll,因为其他东西取决于那个版本的 dll,所以我将 Location 类迁移到我的项目中。 [SolrField("geocode")] public LocationSolr GeoCode { get;放; }
猜你喜欢
  • 1970-01-01
  • 2011-04-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-06-17
  • 1970-01-01
相关资源
最近更新 更多