Adds hierarchical faceting to EPiServer Find's .NET API
In order to build HierarchicalFacet2Find the NuGet packages that it depends on must be restored. See http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages
Add a Hierarchy property to the document:
public class Document
{
[Id]
public string Id { get; set; }
public Hierarchy Hierarchy { get; set; }
}
set the hierarchy path (sections separated by '/'):
document.Hierarchy = "A/B/C/D";
index and request a HierarchicalFacet when searching:
result = client.Search<Document>()
.HierarchicalFacetFor(x => x.Hierarchy)
.GetResult();
fetch it from the result:
facet = result.HierarchicalFacetFor(x => x.Hierarchy)
and loop over the nested hierarchy paths
foreach(var hierarchyPath in facet)
{
hierarchyPath.Path;
hierarchyPath.Count;
foreach (var subHierarchyPath in hierarchyPath)
{
subHierarchyPath.Path;
subHierarchyPath.Count;
...
}
}