Skip to main content
Support Help Center Help Center home page
AI OnAI Off
Developer documentation Developer community Optimizely Academy Submit a request Sign in
  1. Support Help Center
  2. Optimizely support
  3. API

How to filter out expired content in Episerver Search

  • Updated March 23, 2018 20:18

Description

This article contains a sample that explicitly will exclude expired content in Episerver Search results.

Resolution

private bool IsPublished(IVersionable content)
{
if (content == null)
return true;
if (content.StopPublish > DateTime.UtcNow)
return content.Status.HasFlag(VersionStatus.Published);

return false;
}

Please sign in to leave a comment.

Articles in this section

  • Dynamic Data Store Remap EPiServer.Core.PageObject
  • Deleting old content versions using the API
  • Enable special characters in URL Segment
  • How to stop a custom job in Admin UI in case your job has a loop.
  • How to remove/hide media and email options when creating hyperlink popup in CMS
  • Expanding Nested Block for Content Delivery API v3 (CMS 12)
  • 401 Error when using REST API/ ContentDelivery API in multi instance environment
  • How to setup Content Delivery API with Entra ID (formerly Azure AD) and OpenIDConnect
  • Simple sample on how to use interfaces and allowed types on cms 12
  • How to translate an internal url to external url

See all 39 articles

Optimizely Website Support Policy Privacy Notice Website terms of use Cookie settings Trust center Third-Party Addons & Platforms
Deutsch