mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 02:44:52 +08:00
Fixing duplicated search results
Work Item: 17180 --HG-- branch : 1.x
This commit is contained in:
@@ -103,8 +103,7 @@ namespace Orchard.Indexing.Services {
|
||||
? _repository.Fetch(x => true).ToArray()
|
||||
: _repository.Fetch(x => x.CreatedUtc >= lastIndexUtc).ToArray(); // CreatedUtc and lastIndexUtc might be equal if a content item is created in a background task
|
||||
|
||||
|
||||
// nothing to do ?
|
||||
// nothing to do ?)))
|
||||
if (taskRecords.Length + updateIndexDocuments.Count == 0) {
|
||||
Logger.Information("Index update requested, nothing to do");
|
||||
return;
|
||||
@@ -137,6 +136,10 @@ namespace Orchard.Indexing.Services {
|
||||
if (!settings.Included)
|
||||
continue;
|
||||
|
||||
// skip items which already are in updateIndexDocuments
|
||||
if (addedContentItemIds.Contains(task.ContentItem.Id.ToString()))
|
||||
continue;
|
||||
|
||||
try {
|
||||
var documentIndex = _indexProvider.New(task.ContentItem.Id);
|
||||
_contentManager.Index(task.ContentItem, documentIndex);
|
||||
|
Reference in New Issue
Block a user