From 3d87a1ec91001698573632a2a25c45aae9fefbf1 Mon Sep 17 00:00:00 2001 From: Nick Dalsgaard Pedersen Date: Tue, 29 Jul 2025 09:27:07 +0200 Subject: [PATCH] Match BuildIndex logic with ContentRefresher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added p.Published check in the BuildIndex loop so it skips unpublished items too — same as ContentRefresher already does. --- .../Controllers/SearchController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Cms.Integrations.Search.Algolia/Controllers/SearchController.cs b/src/Umbraco.Cms.Integrations.Search.Algolia/Controllers/SearchController.cs index 9a41ba21..ff433b77 100644 --- a/src/Umbraco.Cms.Integrations.Search.Algolia/Controllers/SearchController.cs +++ b/src/Umbraco.Cms.Integrations.Search.Algolia/Controllers/SearchController.cs @@ -139,7 +139,7 @@ public async Task BuildIndex([FromBody] IndexConfiguration indexC _logger.LogInformation("Building index for {ContentType} with {Count} items", contentDataItem.ContentType.Alias, contentItems.Count()); - foreach (var contentItem in contentItems.Where(p => !p.Trashed)) + foreach (var contentItem in contentItems.Where(p => !p.Trashed && p.Published)) { var record = new ContentRecordBuilder( _userService,