Adds facet filtering to EPiServer Find's .NET API
Switch branches/tags
Nothing to show
Clone or download
Henrik Lindström
Henrik Lindström Added .nuget
Latest commit a633dc8 Mar 14, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.nuget Added .nuget Mar 14, 2018
FacetFilter2Find.Tests Version 1.1.0 Mar 14, 2018
FacetFilter2Find Version 1.1.0 Mar 14, 2018
.gitignore Initial commit Jun 2, 2016
FacetFilter2Find.sln Initial commit Jun 2, 2016
Readme.md Initial commit Jun 2, 2016

Readme.md

FacetFilter2Find

Adds facet filtering to EPiServer Find's .NET API

Build

In order to build FacetFilter2Find using NuGet < 2.7 the NuGet packages that it depends on must be restored. See http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages

Usage

To filter a facet to be calculated on only a subset of the documents in the result set:

result = client.Search<Document>()
                        .TermsFacetFor(x => x.Category, x => x.Type.Match("pdf"))
                        .GetResult();

facet = result.TermsFacetFor(x => x.Category);

To add multiple facets on a single field with different filters:

result = client.Search<Document>()
                        .TermsFacetFor(x => x.Category, x => x.Type.Match("pdf"), x => x.Name = "PdfCategories")
                        .TermsFacetFor(x => x.Category, x => x.Type.Match("doc"), x => x.Name = "DocCategories")
                        .GetResult();

pdfTypeFacet = result.Facets["PdfCategories"] as TermsFacet;
docTypeFacet = result.Facets["DocCategories"] as TermsFacet;