mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Fixing drafts indexing
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Orchard.Indexing.Handlers {
|
||||
_indexingTaskManager = indexingTaskManager;
|
||||
|
||||
OnCreated<ContentPart>(CreateIndexingTask);
|
||||
OnVersioned<ContentPart>(CreateIndexingTask);
|
||||
OnUpdated<ContentPart>(CreateIndexingTask);
|
||||
OnPublished<ContentPart>(CreateIndexingTask);
|
||||
OnUnpublished<ContentPart>(CreateIndexingTask);
|
||||
OnRemoved<ContentPart>(RemoveIndexingTask);
|
||||
@@ -24,8 +24,8 @@ namespace Orchard.Indexing.Handlers {
|
||||
_indexingTaskManager.CreateUpdateIndexTask(context.ContentItem);
|
||||
}
|
||||
|
||||
void CreateIndexingTask(VersionContentContext context, ContentPart part1, ContentPart part2) {
|
||||
_indexingTaskManager.CreateUpdateIndexTask(context.BuildingContentItem);
|
||||
void CreateIndexingTask(UpdateContentContext context, ContentPart part) {
|
||||
_indexingTaskManager.CreateUpdateIndexTask(context.ContentItem);
|
||||
}
|
||||
|
||||
void CreateIndexingTask(PublishContentContext context, ContentPart part) {
|
||||
|
@@ -206,7 +206,7 @@ namespace Orchard.Indexing.Services {
|
||||
.Take(ContentItemsPerLoop)
|
||||
.ToList()
|
||||
.GroupBy(x => x.ContentItemRecord.Id)
|
||||
.Select(group => new {TaskId = group.Max(task => task.Id), Delete = group.Last().Action == IndexingTaskRecord.Delete, Id = group.Key, ContentItem = _contentManager.Get(group.Key, VersionOptions.Published)})
|
||||
.Select(group => new { TaskId = group.Max(task => task.Id), Delete = group.Last().Action == IndexingTaskRecord.Delete, Id = group.Key, ContentItem = _contentManager.Get(group.Key, VersionOptions.Latest) })
|
||||
.OrderBy(x => x.TaskId)
|
||||
.ToArray();
|
||||
|
||||
|
Reference in New Issue
Block a user