Skip to content

x2find/HierarchicalFacet2Find

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

HierarchicalFacet2Find

Adds hierarchical faceting to EPiServer Find's .NET API

Build

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

Usage

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

About

Adds hierarchical faceting to EPiServer Find's .NET API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages