mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
@@ -63,9 +63,21 @@ namespace Orchard.Indexing.Settings {
|
||||
}
|
||||
|
||||
private void CreateTasksForType(string type) {
|
||||
foreach (var contentItem in _contentManager.Query(VersionOptions.Published, new [] { type }).List()) {
|
||||
_indexingTaskManager.CreateUpdateIndexTask(contentItem);
|
||||
}
|
||||
var index = 0;
|
||||
bool contentItemProcessed;
|
||||
|
||||
// todo: load ids only, or create a queued job
|
||||
|
||||
do {
|
||||
contentItemProcessed = false;
|
||||
var contentItemsToIndex = _contentManager.Query(VersionOptions.Published, new [] { type }).Slice(index, 50);
|
||||
|
||||
foreach (var contentItem in contentItemsToIndex) {
|
||||
contentItemProcessed = true;
|
||||
_indexingTaskManager.CreateUpdateIndexTask(contentItem);
|
||||
}
|
||||
|
||||
} while (contentItemProcessed);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user