protected virtual void ConvertNewArrivals(CatalogSearchQuery query, RouteData routeData, string origin)
        {
            var newForMaxDays = _catalogSettings.LabelAsNewForMaxDays ?? 0;

            if (newForMaxDays <= 0)
            {
                // we cannot filter without it
                return;
            }

            bool newArrivalsOnly;
            var  fromUtc = DateTime.UtcNow.Subtract(TimeSpan.FromDays(newForMaxDays));

            if (GetValueFor(query, "n", FacetGroupKind.NewArrivals, out newArrivalsOnly) && newArrivalsOnly)
            {
                query.CreatedBetween(fromUtc, null);
            }

            AddFacet(query, FacetGroupKind.NewArrivals, true, FacetSorting.LabelAsc, descriptor =>
            {
                descriptor.AddValue(new FacetValue(fromUtc, null, IndexTypeCode.DateTime, true, false)
                {
                    IsSelected = newArrivalsOnly,
                    Label      = _services.Localization.GetResource("Search.Facet.LastDays").FormatInvariant(newForMaxDays)
                });
            });
        }
        protected virtual void ConvertNewArrivals(CatalogSearchQuery query, string origin)
        {
            var newForMaxDays = _catalogSettings.LabelAsNewForMaxDays ?? 0;

            if (newForMaxDays <= 0)
            {
                // We cannot filter without it.
                return;
            }

            var fromUtc = DateTime.UtcNow.Subtract(TimeSpan.FromDays(newForMaxDays));
            var alias   = _catalogSearchQueryAliasMapper.GetCommonFacetAliasByGroupKind(FacetGroupKind.NewArrivals, query.LanguageId ?? 0);

            if (TryGetValueFor(alias ?? "n", out bool newArrivalsOnly) && newArrivalsOnly)
            {
                query.CreatedBetween(fromUtc, null);
            }

            AddFacet(query, FacetGroupKind.NewArrivals, true, FacetSorting.LabelAsc, descriptor =>
            {
                var label = _services.Localization.GetResource("Search.Facet.LastDays");

                descriptor.AddValue(new FacetValue(fromUtc, null, IndexTypeCode.DateTime, true, false)
                {
                    IsSelected = newArrivalsOnly,
                    Label      = label.FormatInvariant(newForMaxDays)
                });
            });
        }