2012-11-01 22 views
1

ISolrQueryResults工作與solrNet 3.0ISolrQueryResults不solrNet 4.0

工作就像我與solrNet 3.0代碼爲

 ISolrOperations<ProductTest2> solr = ServiceLocator.Current.GetInstance<ISolrOperations<ProductTest2>>(); 
     ISolrQueryResults<ProductTest2> powerArticles = solr.Query(new SolrQuery("is_OneCategoryActive:true") , new QueryOptions 
     { 
      FilterQueries = new[] { new SolrQueryByRange<Int32>("bestsellercurrent",1, 5) }, 
      Start = 0, 
      Rows = 5 
     } 
     ); 

現在其停止與solrNet 4.0工作。請建議我什麼,我需要改變。

回答

7

ISolrQueryResults界面與SolrNet 0.4.0 Beta1的發行版中刪除。你可以只是SolrQueryResults取代它。請參閱release notes的重大更改部分。

所以下面將現在的工作:

ISolrOperations<ProductTest2> solr = ServiceLocator.Current.GetInstance<ISolrOperations<ProductTest2>>(); 
SolrQueryResults<ProductTest2> powerArticles = solr.Query(new SolrQuery("is_OneCategoryActive:true") , new QueryOptions 
    { 
     FilterQueries = new[] { new SolrQueryByRange<Int32>("bestsellercurrent",1, 5) }, 
     Start = 0, 
     Rows = 5 
    } 
    ); 
+0

非常感謝先生。 – Ashutosh