mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +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 => 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
|
: _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) {
|
if (taskRecords.Length + updateIndexDocuments.Count == 0) {
|
||||||
Logger.Information("Index update requested, nothing to do");
|
Logger.Information("Index update requested, nothing to do");
|
||||||
return;
|
return;
|
||||||
@@ -137,6 +136,10 @@ namespace Orchard.Indexing.Services {
|
|||||||
if (!settings.Included)
|
if (!settings.Included)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// skip items which already are in updateIndexDocuments
|
||||||
|
if (addedContentItemIds.Contains(task.ContentItem.Id.ToString()))
|
||||||
|
continue;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var documentIndex = _indexProvider.New(task.ContentItem.Id);
|
var documentIndex = _indexProvider.New(task.ContentItem.Id);
|
||||||
_contentManager.Index(task.ContentItem, documentIndex);
|
_contentManager.Index(task.ContentItem, documentIndex);
|
||||||
|
Reference in New Issue
Block a user