Fixing duplicated search results

Work Item: 17180

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2011-01-07 15:51:10 -08:00
parent 4c9ad3831d
commit e7aa93170b

View File

@@ -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);