简体   繁体   English

Solrnet和集群

[英]Solrnet & Clustering

Is it possible to get clustering in Solr querying via SolrNet? 通过SolrNet可以在Solr查询中获得聚类吗? using built-in algos. 使用内置算法。 like Carrot2 etc.? 像Carrot2等? Can anyone share some sample code or tips to proceed? 任何人都可以分享一些示例代码或提示以继续吗?

No, Solr clustering is not currently implemented in SolrNet. 否,SolrNet当前未实现Solr集群 It doesn't seem to be hard to implement though. 不过,似乎并不难实现。 Here's an outline of what it would take: 以下是有关内容的概述:

  • Model the Solr response for clusters as a class (eg ClusteringResult ). 将群集的Solr响应建模为一个类(例如ClusteringResult )。 For example, StatsResult models the response for the StatsComponent. 例如, StatsResult为StatsComponent的响应建模。
  • Add a property for ClusteringResult in ISolrQueryResults<T> and SolrQueryResults<T> ISolrQueryResults<T>SolrQueryResults<T>ClusteringResult添加属性
  • Implement a ISolrResponseParser<T> to parse the part of Solr XML response with the clustering information and load a ClusteringResult object. 实现一个ISolrResponseParser<T>以使用聚类信息解析Solr XML响应的一部分,并加载一个ClusteringResult对象。 See other response parsers for reference. 请参阅其他响应解析器以供参考。
  • Register the response parser in the built-in container , the Ninject module , the Windsor facility and the StructureMap registry . 内置容器Ninject模块Windsor工具StructureMap注册表中注册响应解析器。
  • Model the parameters involved in the query as a class (eg ClusteringParameters ). 将查询中涉及的参数建模为一个类(例如ClusteringParameters )。 This would include a property to mirror carrot.algorithm, another for carrot.url, etc. 这将包括一个属性以镜像胡萝卜.algorithm,另一个用于胡萝卜.url,等等。
  • Add a property for ClusteringParameters in QueryOptions . QueryOptionsClusteringParameters添加一个属性。
  • Serialize this ClusteringParameters to querystring parameters in SolrQueryExecuter . 将这个ClusteringParameters序列SolrQueryExecuter querystring参数。

And of course, unit tests for everything. 当然, 单元测试适用于所有内容。 Ideally, also an integration test. 理想情况下,还要进行集成测试。

Then send me a pull request ;-) 然后给我发送请求请求;-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM