Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Facet with filter



I'm building a facet with a filter (in a nested structure). The facet with filter stops to work randomlly. 

My facet/filter

f =>
f.PriceIsSellable.Match(true) &
f.Currency.Match(filter.Currency) &
f.CountryCodes.Match(filter.Country) &
f.ValidFrom.Before(DateTime.UtcNow) &

Debugging the problem is with the filter fGbp.ValidFrom.Before(DateTime.UtcNow).  I've checked the data in the index and there is no obvious reason that I can see why it breaks.  Clearning the index and rebuild seems to fix the issue for the time being.

We are using EPiServer Find version

Thanks in advance


Jan 29, 2016 12:27

Some kind of caching problem maybe? Possible to run without cache and try?

Jan 29, 2016 12:42

Hi Daniel,

thanks for replying.  The search query is without caching.

Worth to mention that changing the filter to f.ValidFrom.InRange(DateTime.MinValue, DateTime.MaxValue still have the same result (returning no facets).

Jan 29, 2016 12:45


Can you check if you by accident index null values? Range/before/after will not match a null/non existant value.


Jan 29, 2016 13:35

Not an answer to the original question, but in case you are going to cache this using StaticallyCacheFor - make sure that you are not using DateTime.Now / DateTime.UtcNow as this will create unique queries for every second passed :-)

Jan 29, 2016 13:52


@Henrik, all our dates have values. If the validTo date is not set in the CMS/Commerce, we set it to the max date.

@Per, thanks for the heads up :-)!


Jan 29, 2016 16:35


I've renamed the ValidFrom and ValidTo fields to PriceValidFrom and PriceValidTo.  Its been a week and not problems yet (fingers crossed :-)

I'm not sure why it makes a difference, but though it worth to mention.

Feb 10, 2016 11:49
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.