我在Lucene 3.0.3中使用SimpleFacetedSearch。对于以下代码,Lucene.net 4.8.0中的等效内容是什么? SimpleFacetedSearch不再存在。
这是我从V3.0.3起的代码
var facet = new SimpleFacetedSearch(reader, searchFacetField.SearchIndexField);
var result = facet.Search(query);
var hits = result.HitsPerFacet
.Where(h => h.HitCount > 0)
.OrderByDescending(h => h.HitCount)
.Take(availableSearchFacetField.MaxResults);
searchFacetField.TotalHitCount = result.TotalHitCount;
searchFacetField.SearchFacetObject.SearchFacetList = new List<DtoSearchFacet>();
foreach (var hit in hits)
{
DtoSearchFacet searchFacet = new DtoSearchFacet();
searchFacet.HitResultCount = hit.HitCount;
searchFacet.HitResultId = hit.Name.ToString();
...
}