How can I ignored archived content in IContentQueryExecutor?

I have the following code/query:

var builder = new ContentItemQueryBuilder()
	.ForContentType(
		ClientStoryDetail.CONTENT_TYPE_NAME,
		config => config
			.Where(where => where
				.WhereContainsTags(nameof(ClientStoryDetail.InternalStoryType), [diagnosedTag.Identifier])
				.Or()
				.WhereContainsTags(nameof(ClientStoryDetail.InternalStoryType), [caregiverTag.Identifier])
				.Or()
				.WhereContainsTags(nameof(ClientStoryDetail.InternalStoryType), [bereavedTag.Identifier])
			)
			.ForWebsite(contextHelper.CurrentSiteName, includeUrlPath: true)
			.WithLinkedItems(2));
			
var contentQueryExecutionOptions = new ContentQueryExecutionOptions()
{
	ForPreview = false
};

var webpageResult = await _contentQueryExecutor.GetMappedWebPageResult<ClientStoryDetail>(
	builder,
	options: contentQueryExecutionOptions);

In that, I would expect that webpageResult would not have any archived items since ForPreview = false, but it is returning archived items.

Is that by design or a bug? It seems a little clunky to add a line in the query about getting only Published versions of something when I'm also passing the ContentQueryExecutionOptions.

Environment

  • Xperience by Kentico version: [30.12.2]

  • .NET version: [8]

Answers

To response this discussion, you have to login first.