From 39f7cc0a784252565d60aac84f31606c1f28c6ea Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Thu, 22 Aug 2013 16:29:21 -0700 Subject: [PATCH] Adding the container id of an item to the index --- src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs b/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs index 292837e47..2d99f793d 100644 --- a/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs +++ b/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs @@ -55,7 +55,13 @@ namespace Orchard.Core.Common.Handlers { .Add("published", commonPart.PublishedUtc ?? _clock.UtcNow).Store() .Add("modified", commonPart.ModifiedUtc ?? _clock.UtcNow).Store(); - if (commonPart.Owner != null) context.DocumentIndex.Add("author", commonPart.Owner.UserName).Analyze().Store(); + if (commonPart.Container != null) { + context.DocumentIndex.Add("container-id", commonPart.Container.Id).Store(); + } + + if (commonPart.Owner != null) { + context.DocumentIndex.Add("author", commonPart.Owner.UserName).Analyze().Store(); + } }); }