Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Epi-Find: TermsFacet for counts inaccurate when corresponding filter is applied

$
0
0

I have the following facet on my Epi Find query.

public void ApplyManufacturerFacet()
{
    this.EpiFindSearch = this.EpiFindSearch.TermsFacetFor(r => r.ManufacturerId);
}


I am using the facet terms to retrieve counts for various filters that could be applied. I apply the filter with the following:

public void SearchByManufacturer(List<string> manufacturers)
{
    var catalogBuilder = this.EpiFindSearch.Client.BuildFilter<SiteProductVariation>();
    foreach (var manufacturer in manufacturers)
    {
        catalogBuilder = catalogBuilder.And(r => r.ManufacturerId.Match(manufacturer));
    }
    this.EpiFindSearch = this.EpiFindSearch.Filter(catalogBuilder);
}


When certain filters are applied, the number of results that are actually returned does not match the number that was returned by my request for the facet count. Here is the calling code for these functions. You can see that the filter is applied first, then the request for the facets is made.

...
if (manufacturers.Count > 0)
{
    search.SearchByManufacturer(manufacturers);
}
this.search.ApplyManufacturerFacet();
...


Viewing all articles
Browse latest Browse all 6894

Trending Articles