Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
I think this is missing, By default IncludePreorderEntry is true then the StartDate will no longer take effect
criteria.IncludePreorderEntry = false;
Unfortunately, it doesn't help.
I chose the product for test, changed Allow Preorder to false for all product variants, rebuilded the index, but the product still in the returned documents from the search manager.
No, I meant for this
var searchCriteria = new CatalogEntrySearchCriteria
Yeah, of course I added that line
var searchCriteria = new CatalogEntrySearchCriteria { StartDate = query.DateFrom, EndDate = query.DateTo, IncludePreorderEntry = false, Locale = "en", MarketId = _currentMarket.GetCurrentMarket().MarketId, StartingRecord = 0 };
But it didnt help, actually nothing changed.
Hi.
I'm trying to find entries according to their start/end dates and it doesnt work. It just ignores start/end dates filter and returns all entries.
I'm using a standard lucene.net search provider, my entries are indexed.
Mediachase.Search.config
Search implementation
public IEnumerable SearchCatalogEntries(CommerceSearchQuery query) { if (query == null) { return Enumerable.Empty(); } var searchCriteria = new CatalogEntrySearchCriteria { StartDate = query.DateFrom, EndDate = query.DateTo, Locale = "en", MarketId = _currentMarket.GetCurrentMarket().MarketId, StartingRecord = 0 }; switch (query.EntryType) { case CommerceSearchEntryType.Variant: searchCriteria.ClassTypes.Add("variation"); break; case CommerceSearchEntryType.Product: searchCriteria.ClassTypes.Add("product"); break; } var manager = new SearchManager(_applicationName); ISearchResults results; try { results = manager.Search(searchCriteria); } catch (Exception e) { _logger.Error(e.Message, e); return Enumerable.Empty(); } if (results.Documents == null || results.TotalCount == 0) { return Enumerable.Empty(); } return results.Documents.Select(x => { var entryId = int.Parse(x["_id"].Value.ToString()); var entryReference = _referenceConverter.GetContentLink(entryId, CatalogContentType.CatalogEntry, 0); IContent entry; _contentLoader.TryGet(entryReference, out entry); return entry as EntryContentBase; }); }
Can someone help me to understand what's wrong?
Thanks.