minor improvements to indexing performance
(cherry picked from commit b7a26360e5)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
4b2af296be
commit
bfd29dfc3b
@@ -72,7 +72,7 @@ public class UmbracoContentIndex : UmbracoExamineIndex, IUmbracoContentIndex
|
||||
ValueSetValidationResult validationResult = ValueSetValidator.Validate(v);
|
||||
|
||||
return validationResult.Status;
|
||||
}).ToList();
|
||||
}).ToArray();
|
||||
|
||||
var hasDeletes = false;
|
||||
var hasUpdates = false;
|
||||
@@ -86,7 +86,7 @@ public class UmbracoContentIndex : UmbracoExamineIndex, IUmbracoContentIndex
|
||||
hasUpdates = true;
|
||||
|
||||
//these are the valid ones, so just index them all at once
|
||||
base.PerformIndexItems(group.ToList(), onComplete);
|
||||
base.PerformIndexItems(group.ToArray(), onComplete);
|
||||
break;
|
||||
case ValueSetValidationStatus.Failed:
|
||||
// don't index anything that is invalid
|
||||
|
||||
@@ -95,7 +95,7 @@ public abstract class UmbracoExamineIndex : LuceneIndex, IUmbracoIndex, IIndexDi
|
||||
Document? d = docArgs.Document;
|
||||
|
||||
foreach (KeyValuePair<string, IReadOnlyList<object>> f in docArgs.ValueSet.Values
|
||||
.Where(x => x.Key.StartsWith(UmbracoExamineFieldNames.RawFieldPrefix)).ToList())
|
||||
.Where(x => x.Key.StartsWith(UmbracoExamineFieldNames.RawFieldPrefix)).ToArray())
|
||||
{
|
||||
if (f.Value.Count > 0)
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ContentIndexPopulator : IndexPopulator<IUmbracoContentIndex>
|
||||
{
|
||||
content = _contentService.GetPagedDescendants(contentParentId, pageIndex, pageSize, out _).ToArray();
|
||||
|
||||
var valueSets = _contentValueSetBuilder.GetValueSets(content).ToList();
|
||||
var valueSets = _contentValueSetBuilder.GetValueSets(content).ToArray();
|
||||
|
||||
// ReSharper disable once PossibleMultipleEnumeration
|
||||
foreach (IIndex index in indexes)
|
||||
@@ -145,7 +145,7 @@ public class ContentIndexPopulator : IndexPopulator<IUmbracoContentIndex>
|
||||
}
|
||||
}
|
||||
|
||||
var valueSets = _contentValueSetBuilder.GetValueSets(indexableContent.ToArray()).ToList();
|
||||
var valueSets = _contentValueSetBuilder.GetValueSets(indexableContent.ToArray()).ToArray();
|
||||
|
||||
foreach (IIndex index in indexes)
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ValueSetValidator : IValueSetValidator
|
||||
// filter based on the fields provided (if any)
|
||||
if (IncludeFields != null || ExcludeFields != null)
|
||||
{
|
||||
foreach (var key in valueSet.Values.Keys.ToList())
|
||||
foreach (var key in valueSet.Values.Keys.ToArray())
|
||||
{
|
||||
if (IncludeFields != null && !IncludeFields.InvariantContains(key))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user