mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Populate search index snapshots from main handlers (common, body and routable)
--HG-- branch : dev
This commit is contained in:
@@ -9,9 +9,9 @@ namespace Orchard.Core.Common.Handlers {
|
||||
public BodyAspectHandler(IRepository<BodyRecord> bodyRepository) {
|
||||
Filters.Add(StorageFilter.For(bodyRepository));
|
||||
|
||||
OnIndexing<BodyAspect>((context, bodyAspect) => {
|
||||
context.IndexDocument.Add("body", bodyAspect.Record.Text);
|
||||
});
|
||||
OnIndexing<BodyAspect>((context, bodyAspect) => context.IndexDocument
|
||||
.Add("body", bodyAspect.Record.Text)
|
||||
.Add("format", bodyAspect.Record.Format));
|
||||
}
|
||||
}
|
||||
}
|
@@ -54,6 +54,14 @@ namespace Orchard.Core.Common.Handlers {
|
||||
//OnGetDisplayViewModel<CommonAspect>();
|
||||
OnGetEditorViewModel<CommonAspect>(GetEditor);
|
||||
OnUpdateEditorViewModel<CommonAspect>(UpdateEditor);
|
||||
|
||||
OnIndexing<CommonAspect>((context, commonAspect) => context.IndexDocument
|
||||
.Add("type", commonAspect.ContentItem.ContentType)
|
||||
.Add("author", commonAspect.Owner.UserName)
|
||||
.Add("created", commonAspect.CreatedUtc ?? _clock.UtcNow)
|
||||
.Add("published", commonAspect.PublishedUtc ?? _clock.UtcNow)
|
||||
.Add("modified", commonAspect.ModifiedUtc ?? _clock.UtcNow)
|
||||
);
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
@@ -36,6 +36,10 @@ namespace Orchard.Core.Common.Handlers {
|
||||
|
||||
OnCreated<RoutableAspect>((context, ra) => routableService.ProcessSlug(ra));
|
||||
|
||||
OnIndexing<RoutableAspect>((context, part) => context.IndexDocument
|
||||
.Add("slug", part.Slug)
|
||||
.Add("title", part.Title)
|
||||
);
|
||||
}
|
||||
|
||||
private static RouteValueDictionary GetRouteValues(IContentItemDriver driver, ContentItem contentItem) {
|
||||
|
Reference in New Issue
Block a user