lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Incite <i...@incite.ch>
Subject What is the equivalent of SimpleFacetedSearch in Lucene.net 4.8.0
Date Wed, 12 Dec 2018 08:42:16 GMT
Hi,

I use the SimpleFacetedSearch in Lucene 3.0.3. What would be the equivalent in Lucene.net
4.8.0 for the following code? SimpleFacetedSearch doesn't exists anymore.

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();
  ...
}

Thank you very much for your help.

Best regards.
Ivan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message