Try our conversational search powered by Generative AI!

Facet with filter

Vote:
 

Hi,

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) &
f.ValidTo.After(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 10.1.0.3493

Thanks in advance

Danie

#143731
Jan 29, 2016 12:27
Vote:
 

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

#143733
Jan 29, 2016 12:42
Vote:
 

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).

#143734
Jan 29, 2016 12:45
Vote:
 

Hi,

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

/Henrik

#143743
Jan 29, 2016 13:35
Vote:
 

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 :-)

#143744
Jan 29, 2016 13:52
Vote:
 

Hi,

@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 :-)!

Danie

#143762
Jan 29, 2016 16:35
Vote:
 

Hi,

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.

#144281
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.