RuiJi.Solr.Net

      RuiJi.Solr.Net已关闭评论

项目地址

https://github.com/zhupingqi/Regards.Solr.Net

RuiJi.Solr.Net 是 .Net 访问Solrl类库,类库内置的常用的Request定义及对应的Handler,并可以自行扩展这些。

添加Handler

var connection = new SolrConnection("http://192.168.101.3:8986/solr");

var newsServer = new SolrServer(connection);
newsServer.AddHandler<SolrAnalysisHandler >();
newsServer.AddHandler<SolrSelectHandler >();
newsServer.AddHandler<SolrUpdateHandler >();
newsServer.AddHandler<SolrMltHandler >();

查询结果

var query = new SolrSelectRequest();
query.q = "*:*";
query.fq = new List<string>() { "id:160600001623" };

var response = selectHandler.Request(query);
response.Wait();

var d = response.Result.GetData<SolrResponse<WebDocument>>();

 

© 2018, RuiJi 社区. 版权所有.转载请注明出处