SolrNet queries with boost functions

人走茶凉 提交于 2019-12-19 10:25:54

问题


I'm trying to use this library (which looks very nice) but I'm having difficulty understanding how to add extra params to my queries such as boost functions etc. How can this be done?


回答1:


You can use the ExtraParams property of QueryOptions to add any parameter to the Solr querystring. Example:

ISolrOperations<Document> solr = ...
var results = solr.Query("myquery", new QueryOptions {
  ExtraParams = new Dictionary<string, string> {
    {"bf", "recip(rord(myfield),1,2,3)^1.5"}
  }
});


来源:https://stackoverflow.com/questions/1577074/solrnet-queries-with-boost-functions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!