diff --git a/src/Umbraco.Core/EnumerableExtensions.cs b/src/Umbraco.Core/EnumerableExtensions.cs index c455fadad7..2563d2e5dc 100644 --- a/src/Umbraco.Core/EnumerableExtensions.cs +++ b/src/Umbraco.Core/EnumerableExtensions.cs @@ -1,11 +1,6 @@ using System; -using System.Collections; using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq; -using System.Text; -using Umbraco.Core.Logging; namespace Umbraco.Core { @@ -14,6 +9,17 @@ namespace Umbraco.Core /// public static class EnumerableExtensions { + /// + /// Wraps this object instance into an IEnumerable{T} consisting of a single item. + /// + /// Type of the object. + /// The instance that will be wrapped. + /// An IEnumerable{T} consisting of a single item. + public static IEnumerable Yield(this T item) + { + yield return item; + } + public static IEnumerable> InGroupsOf(this IEnumerable source, int groupSize) { if (source == null) diff --git a/src/Umbraco.Examine/BaseValueSetBuilder.cs b/src/Umbraco.Examine/BaseValueSetBuilder.cs index d0c6069add..9e36f43793 100644 --- a/src/Umbraco.Examine/BaseValueSetBuilder.cs +++ b/src/Umbraco.Examine/BaseValueSetBuilder.cs @@ -22,7 +22,7 @@ namespace Umbraco.Examine /// public abstract IEnumerable GetValueSets(params TContent[] content); - protected void AddPropertyValue(Property property, string culture, string segment, IDictionary values) + protected void AddPropertyValue(Property property, string culture, string segment, IDictionary> values) { var editor = _propertyEditors[property.PropertyType.PropertyEditorAlias]; if (editor == null) return; @@ -48,7 +48,7 @@ namespace Umbraco.Examine if (values.TryGetValue(key, out var v)) values[key] = new List(v) { val }.ToArray(); else - values.Add($"{keyVal.Key}{cultureSuffix}", new[] { val }); + values.Add($"{keyVal.Key}{cultureSuffix}", val.Yield()); } break; default: @@ -57,7 +57,7 @@ namespace Umbraco.Examine if (values.TryGetValue(key, out var v)) values[key] = new List(v) { val }.ToArray(); else - values.Add($"{keyVal.Key}{cultureSuffix}", new[] { val }); + values.Add($"{keyVal.Key}{cultureSuffix}", val.Yield()); } break; diff --git a/src/Umbraco.Examine/ContentIndexPopulator.cs b/src/Umbraco.Examine/ContentIndexPopulator.cs index c84b251786..8127a8c3d3 100644 --- a/src/Umbraco.Examine/ContentIndexPopulator.cs +++ b/src/Umbraco.Examine/ContentIndexPopulator.cs @@ -61,7 +61,7 @@ namespace Umbraco.Examine RegisterIndex(Constants.UmbracoIndexes.ExternalIndexName); } - protected override void PopulateIndexes(IEnumerable indexes) + protected override void PopulateIndexes(IEnumerable indexes) { const int pageSize = 10000; var pageIndex = 0; diff --git a/src/Umbraco.Examine/ContentValueSetBuilder.cs b/src/Umbraco.Examine/ContentValueSetBuilder.cs index 258f24c21e..056e137c07 100644 --- a/src/Umbraco.Examine/ContentValueSetBuilder.cs +++ b/src/Umbraco.Examine/ContentValueSetBuilder.cs @@ -35,9 +35,9 @@ namespace Umbraco.Examine var isVariant = c.ContentType.VariesByCulture(); var urlValue = c.GetUrlSegment(_urlSegmentProviders); //Always add invariant urlName - var values = new Dictionary + var values = new Dictionary> { - {"icon", new [] {c.ContentType.Icon}}, + {"icon", c.ContentType.Icon.Yield()}, {UmbracoExamineIndexer.PublishedFieldName, new object[] {c.Published ? 1 : 0}}, //Always add invariant published value {"id", new object[] {c.Id}}, {"key", new object[] {c.Key}}, @@ -47,12 +47,12 @@ namespace Umbraco.Examine {"sortOrder", new object[] {c.SortOrder}}, {"createDate", new object[] {c.CreateDate}}, //Always add invariant createDate {"updateDate", new object[] {c.UpdateDate}}, //Always add invariant updateDate - {"nodeName", new object[] {c.Name}}, //Always add invariant nodeName - {"urlName", new object[] {urlValue}}, //Always add invariant urlName - {"path", new object[] {c.Path}}, + {"nodeName", c.Name.Yield()}, //Always add invariant nodeName + {"urlName", urlValue.Yield()}, //Always add invariant urlName + {"path", c.Path.Yield()}, {"nodeType", new object[] {c.ContentType.Id}}, - {"creatorName", new object[] {c.GetCreatorProfile(_userService)?.Name ?? "??"}}, - {"writerName", new object[] {c.GetWriterProfile(_userService)?.Name ?? "??"}}, + {"creatorName", (c.GetCreatorProfile(_userService)?.Name ?? "??").Yield() }, + {"writerName",(c.GetWriterProfile(_userService)?.Name ?? "??").Yield() }, {"writerID", new object[] {c.WriterId}}, {"template", new object[] {c.Template?.Id ?? 0}}, {UmbracoContentIndexer.VariesByCultureFieldName, new object[] {0}}, @@ -66,8 +66,8 @@ namespace Umbraco.Examine { var variantUrl = c.GetUrlSegment(_urlSegmentProviders, culture); var lowerCulture = culture.ToLowerInvariant(); - values[$"urlName_{lowerCulture}"] = new object[] { variantUrl }; - values[$"nodeName_{lowerCulture}"] = new object[] { c.GetCultureName(culture) }; + values[$"urlName_{lowerCulture}"] = variantUrl.Yield(); + values[$"nodeName_{lowerCulture}"] = c.GetCultureName(culture).Yield(); values[$"{UmbracoExamineIndexer.PublishedFieldName}_{lowerCulture}"] = new object[] { c.IsCulturePublished(culture) ? 1 : 0 }; values[$"updateDate_{lowerCulture}"] = new object[] { c.GetUpdateDate(culture) }; } diff --git a/src/Umbraco.Examine/ExamineExtensions.cs b/src/Umbraco.Examine/ExamineExtensions.cs index b0657bc502..3681979267 100644 --- a/src/Umbraco.Examine/ExamineExtensions.cs +++ b/src/Umbraco.Examine/ExamineExtensions.cs @@ -7,7 +7,7 @@ using Lucene.Net.Store; namespace Umbraco.Examine { /// - /// Extension methods for the LuceneIndexer + /// Extension methods for the LuceneIndex /// internal static class ExamineExtensions { @@ -17,7 +17,7 @@ namespace Umbraco.Examine /// /// The exception returned if there was an error /// - public static bool IsHealthy(this LuceneIndexer indexer, out Exception ex) + public static bool IsHealthy(this LuceneIndex indexer, out Exception ex) { try { @@ -39,7 +39,7 @@ namespace Umbraco.Examine /// /// /// - public static int GetIndexDocumentCount(this LuceneIndexer indexer) + public static int GetIndexDocumentCount(this LuceneIndex indexer) { if (!((indexer.GetSearcher() as LuceneSearcher)?.GetLuceneSearcher() is IndexSearcher searcher)) return 0; @@ -56,7 +56,7 @@ namespace Umbraco.Examine /// /// /// - public static int GetIndexFieldCount(this LuceneIndexer indexer) + public static int GetIndexFieldCount(this LuceneIndex indexer) { if (!((indexer.GetSearcher() as LuceneSearcher)?.GetLuceneSearcher() is IndexSearcher searcher)) return 0; diff --git a/src/Umbraco.Examine/IIndexPopulator.cs b/src/Umbraco.Examine/IIndexPopulator.cs index f4c27902eb..ebb977114a 100644 --- a/src/Umbraco.Examine/IIndexPopulator.cs +++ b/src/Umbraco.Examine/IIndexPopulator.cs @@ -9,7 +9,7 @@ namespace Umbraco.Examine /// Populate indexers /// /// - void Populate(params IIndexer[] indexes); + void Populate(params IIndex[] indexes); } } diff --git a/src/Umbraco.Examine/IUmbracoContentIndexer.cs b/src/Umbraco.Examine/IUmbracoContentIndexer.cs index a7cc9f9c2f..09520af1f8 100644 --- a/src/Umbraco.Examine/IUmbracoContentIndexer.cs +++ b/src/Umbraco.Examine/IUmbracoContentIndexer.cs @@ -2,11 +2,11 @@ namespace Umbraco.Examine { - //TODO: Rethink this, need a better way of rebuilding + /// /// A Marker interface for defining an Umbraco content indexer /// - public interface IUmbracoContentIndexer : IIndexer + public interface IUmbracoContentIndexer : IIndex { } } diff --git a/src/Umbraco.Examine/IUmbracoIndexer.cs b/src/Umbraco.Examine/IUmbracoIndexer.cs index 5649a3a866..c3b4a5d629 100644 --- a/src/Umbraco.Examine/IUmbracoIndexer.cs +++ b/src/Umbraco.Examine/IUmbracoIndexer.cs @@ -5,7 +5,7 @@ namespace Umbraco.Examine /// /// A Marker interface for defining an Umbraco indexer /// - public interface IUmbracoIndexer : IIndexer + public interface IUmbracoIndexer : IIndex { /// /// When set to true Umbraco will keep the index in sync with Umbraco data automatically diff --git a/src/Umbraco.Examine/IUmbracoMediaIndexer.cs b/src/Umbraco.Examine/IUmbracoMediaIndexer.cs index 05ab46bec3..c31ab560ff 100644 --- a/src/Umbraco.Examine/IUmbracoMediaIndexer.cs +++ b/src/Umbraco.Examine/IUmbracoMediaIndexer.cs @@ -6,7 +6,7 @@ namespace Umbraco.Examine /// /// A Marker interface for defining an Umbraco media indexer /// - public interface IUmbracoMediaIndexer : IIndexer + public interface IUmbracoMediaIndexer : IIndex { } } diff --git a/src/Umbraco.Examine/IndexPopulator.cs b/src/Umbraco.Examine/IndexPopulator.cs index af5301c230..877f261913 100644 --- a/src/Umbraco.Examine/IndexPopulator.cs +++ b/src/Umbraco.Examine/IndexPopulator.cs @@ -22,11 +22,11 @@ namespace Umbraco.Examine /// public IEnumerable RegisteredIndexes => _registeredIndexes; - public void Populate(params IIndexer[] indexes) + public void Populate(params IIndex[] indexes) { PopulateIndexes(indexes.Where(x => RegisteredIndexes.Contains(x.Name))); } - protected abstract void PopulateIndexes(IEnumerable indexes); + protected abstract void PopulateIndexes(IEnumerable indexes); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Examine/MediaIndexPopulator.cs b/src/Umbraco.Examine/MediaIndexPopulator.cs index 99fa22acea..39a0b3f7c8 100644 --- a/src/Umbraco.Examine/MediaIndexPopulator.cs +++ b/src/Umbraco.Examine/MediaIndexPopulator.cs @@ -42,7 +42,7 @@ namespace Umbraco.Examine RegisterIndex(Constants.UmbracoIndexes.ExternalIndexName); } - protected override void PopulateIndexes(IEnumerable indexes) + protected override void PopulateIndexes(IEnumerable indexes) { const int pageSize = 10000; var pageIndex = 0; diff --git a/src/Umbraco.Examine/MediaValueSetBuilder.cs b/src/Umbraco.Examine/MediaValueSetBuilder.cs index f162c07f59..af41f574fb 100644 --- a/src/Umbraco.Examine/MediaValueSetBuilder.cs +++ b/src/Umbraco.Examine/MediaValueSetBuilder.cs @@ -28,9 +28,9 @@ namespace Umbraco.Examine foreach (var m in media) { var urlValue = m.GetUrlSegment(_urlSegmentProviders); - var values = new Dictionary + var values = new Dictionary> { - {"icon", new object[] {m.ContentType.Icon}}, + {"icon", m.ContentType.Icon.Yield()}, {"id", new object[] {m.Id}}, {"key", new object[] {m.Key}}, {"parentID", new object[] {m.Level > 1 ? m.ParentId : -1}}, @@ -39,11 +39,11 @@ namespace Umbraco.Examine {"sortOrder", new object[] {m.SortOrder}}, {"createDate", new object[] {m.CreateDate}}, {"updateDate", new object[] {m.UpdateDate}}, - {"nodeName", new object[] {m.Name}}, - {"urlName", new object[] {urlValue}}, - {"path", new object[] {m.Path}}, + {"nodeName", m.Name.Yield()}, + {"urlName", urlValue.Yield()}, + {"path", m.Path.Yield()}, {"nodeType", new object[] {m.ContentType.Id}}, - {"creatorName", new object[] {m.GetCreatorProfile(_userService).Name}} + {"creatorName", m.GetCreatorProfile(_userService).Name.Yield()} }; foreach (var property in m.Properties) diff --git a/src/Umbraco.Examine/MemberIndexPopulator.cs b/src/Umbraco.Examine/MemberIndexPopulator.cs index 79dd31436b..b94100f6e3 100644 --- a/src/Umbraco.Examine/MemberIndexPopulator.cs +++ b/src/Umbraco.Examine/MemberIndexPopulator.cs @@ -19,7 +19,7 @@ namespace Umbraco.Examine RegisterIndex(Core.Constants.UmbracoIndexes.MembersIndexName); } - protected override void PopulateIndexes(IEnumerable indexes) + protected override void PopulateIndexes(IEnumerable indexes) { const int pageSize = 1000; var pageIndex = 0; diff --git a/src/Umbraco.Examine/MemberValueSetBuilder.cs b/src/Umbraco.Examine/MemberValueSetBuilder.cs index 14af7de8cb..85a8fa13c5 100644 --- a/src/Umbraco.Examine/MemberValueSetBuilder.cs +++ b/src/Umbraco.Examine/MemberValueSetBuilder.cs @@ -19,9 +19,9 @@ namespace Umbraco.Examine { foreach (var m in members) { - var values = new Dictionary + var values = new Dictionary> { - {"icon", new object[] {m.ContentType.Icon}}, + {"icon", m.ContentType.Icon.Yield()}, {"id", new object[] {m.Id}}, {"key", new object[] {m.Key}}, {"parentID", new object[] {m.Level > 1 ? m.ParentId : -1}}, @@ -30,11 +30,11 @@ namespace Umbraco.Examine {"sortOrder", new object[] {m.SortOrder}}, {"createDate", new object[] {m.CreateDate}}, {"updateDate", new object[] {m.UpdateDate}}, - {"nodeName", new object[] {m.Name}}, - {"path", new object[] {m.Path}}, + {"nodeName", m.Name.Yield()}, + {"path", m.Path.Yield()}, {"nodeType", new object[] {m.ContentType.Id}}, - {"loginName", new object[] {m.Username}}, - {"email", new object[] {m.Email}}, + {"loginName", m.Username.Yield()}, + {"email", m.Email.Yield()}, }; foreach (var property in m.Properties) diff --git a/src/Umbraco.Examine/Umbraco.Examine.csproj b/src/Umbraco.Examine/Umbraco.Examine.csproj index a8898f7fe5..8435025063 100644 --- a/src/Umbraco.Examine/Umbraco.Examine.csproj +++ b/src/Umbraco.Examine/Umbraco.Examine.csproj @@ -48,7 +48,7 @@ - + @@ -84,6 +84,7 @@ + diff --git a/src/Umbraco.Examine/UmbracoContentIndexer.cs b/src/Umbraco.Examine/UmbracoContentIndexer.cs index ddf5f23b4f..00b5a03f1d 100644 --- a/src/Umbraco.Examine/UmbracoContentIndexer.cs +++ b/src/Umbraco.Examine/UmbracoContentIndexer.cs @@ -153,7 +153,7 @@ namespace Umbraco.Examine //need to queue a delete item for each one found foreach (var r in results) { - QueueIndexOperation(new IndexOperation(IndexItem.ForId(r.Id), IndexOperationType.Delete)); + QueueIndexOperation(new IndexOperation(new ValueSet(r.Id, null), IndexOperationType.Delete)); } base.DeleteFromIndex(nodeId); diff --git a/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs b/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs new file mode 100644 index 0000000000..d5d8f9df4b --- /dev/null +++ b/src/Umbraco.Examine/UmbracoExamineIndexDiagnostics.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +using Lucene.Net.Store; +using Umbraco.Core; +using Umbraco.Core.Logging; + +namespace Umbraco.Examine +{ + public class UmbracoExamineIndexDiagnostics : IIndexDiagnostics + { + private readonly UmbracoExamineIndexer _index; + private readonly ILogger _logger; + + public UmbracoExamineIndexDiagnostics(UmbracoExamineIndexer index, ILogger logger) + { + _index = index; + _logger = logger; + } + + public int DocumentCount + { + get + { + try + { + return _index.GetIndexDocumentCount(); + } + catch (AlreadyClosedException) + { + _logger.Warn(typeof(UmbracoContentIndexer), "Cannot get GetIndexDocumentCount, the writer is already closed"); + return 0; + } + } + } + + public int FieldCount + { + get + { + try + { + return _index.GetIndexFieldCount(); + } + catch (AlreadyClosedException) + { + _logger.Warn(typeof(UmbracoContentIndexer), "Cannot get GetIndexFieldCount, the writer is already closed"); + return 0; + } + } + } + + public Attempt IsHealthy() + { + var isHealthy = _index.IsHealthy(out var indexError); + return isHealthy ? Attempt.Succeed() : Attempt.Fail(indexError.Message); + } + + public virtual IReadOnlyDictionary Metadata => new Dictionary + { + [nameof(UmbracoExamineIndexer.CommitCount)] = _index.CommitCount, + [nameof(UmbracoExamineIndexer.DefaultAnalyzer)] = _index.DefaultAnalyzer.GetType(), + [nameof(UmbracoExamineIndexer.DirectoryFactory)] = _index.DirectoryFactory, + [nameof(UmbracoExamineIndexer.EnableDefaultEventHandler)] = _index.EnableDefaultEventHandler, + [nameof(UmbracoExamineIndexer.LuceneIndexFolder)] = _index.LuceneIndexFolder?.ToString(), + [nameof(UmbracoExamineIndexer.SupportSoftDelete)] = _index.SupportSoftDelete, + [nameof(UmbracoExamineIndexer.FieldDefinitionCollection)] = _index.FieldDefinitionCollection, + [nameof(UmbracoExamineIndexer.FieldValueTypeCollection)] = _index.FieldValueTypeCollection, + + }; + } +} diff --git a/src/Umbraco.Examine/UmbracoExamineIndexer.cs b/src/Umbraco.Examine/UmbracoExamineIndexer.cs index cfea6de628..0bd6be5855 100644 --- a/src/Umbraco.Examine/UmbracoExamineIndexer.cs +++ b/src/Umbraco.Examine/UmbracoExamineIndexer.cs @@ -25,7 +25,7 @@ namespace Umbraco.Examine /// An abstract provider containing the basic functionality to be able to query against /// Umbraco data. /// - public abstract class UmbracoExamineIndexer : LuceneIndexer, IUmbracoIndexer, IIndexDiagnostics + public abstract class UmbracoExamineIndexer : LuceneIndex, IUmbracoIndexer, IIndexDiagnostics { // note // wrapping all operations that end up calling base.SafelyProcessQueueItems in a safe call @@ -82,6 +82,8 @@ namespace Umbraco.Examine //try to set the value of `LuceneIndexFolder` for diagnostic reasons if (luceneDirectory is FSDirectory fsDir) LuceneIndexFolder = fsDir.Directory; + + _diagnostics = new UmbracoExamineIndexDiagnostics(this, ProfilingLogger.Logger); } private readonly bool _configBased = false; @@ -315,15 +317,15 @@ namespace Umbraco.Examine /// /// Overridden for logging. /// - protected override void AddDocument(Document doc, IndexItem item, IndexWriter writer) + protected override void AddDocument(Document doc, ValueSet valueSet, IndexWriter writer) { ProfilingLogger.Logger.Debug(GetType(), "Write lucene doc id:{DocumentId}, category:{DocumentCategory}, type:{DocumentItemType}", - item.ValueSet.Id, - item.ValueSet.Category, - item.ValueSet.ItemType); + valueSet.Id, + valueSet.Category, + valueSet.ItemType); - base.AddDocument(doc, item, writer); + base.AddDocument(doc, valueSet, writer); } protected override void OnTransformingIndexValues(IndexingItemEventArgs e) @@ -331,16 +333,16 @@ namespace Umbraco.Examine base.OnTransformingIndexValues(e); //ensure special __Path field - var path = e.IndexItem.ValueSet.GetValue("path"); + var path = e.ValueSet.GetValue("path"); if (path != null) { - e.IndexItem.ValueSet.Set(IndexPathFieldName, path); + e.ValueSet.Set(IndexPathFieldName, path); } //icon - if (e.IndexItem.ValueSet.Values.TryGetValue("icon", out var icon) && e.IndexItem.ValueSet.Values.ContainsKey(IconFieldName) == false) + if (e.ValueSet.Values.TryGetValue("icon", out var icon) && e.ValueSet.Values.ContainsKey(IconFieldName) == false) { - e.IndexItem.ValueSet.Values[IconFieldName] = icon; + e.ValueSet.Values[IconFieldName] = icon; } } @@ -356,53 +358,12 @@ namespace Umbraco.Examine #region IIndexDiagnostics - public int DocumentCount - { - get - { - try - { - return this.GetIndexDocumentCount(); - } - catch (AlreadyClosedException) - { - ProfilingLogger.Logger.Warn(typeof(UmbracoContentIndexer), "Cannot get GetIndexDocumentCount, the writer is already closed"); - return 0; - } - } - } + private readonly UmbracoExamineIndexDiagnostics _diagnostics; - public int FieldCount - { - get - { - try - { - return this.GetIndexFieldCount(); - } - catch (AlreadyClosedException) - { - ProfilingLogger.Logger.Warn(typeof(UmbracoContentIndexer), "Cannot get GetIndexFieldCount, the writer is already closed"); - return 0; - } - } - } - - public Attempt IsHealthy() - { - var isHealthy = this.IsHealthy(out var indexError); - return isHealthy ? Attempt.Succeed() : Attempt.Fail(indexError.Message); - } - - public virtual IReadOnlyDictionary Metadata => new Dictionary - { - [nameof(CommitCount)] = CommitCount, - [nameof(DefaultAnalyzer)] = DefaultAnalyzer.GetType(), - [nameof(DirectoryFactory)] = DirectoryFactory, - [nameof(EnableDefaultEventHandler)] = EnableDefaultEventHandler, - [nameof(LuceneIndexFolder)] = LuceneIndexFolder?.ToString(), - [nameof(SupportSoftDelete)] = SupportSoftDelete - }; + public int DocumentCount => _diagnostics.DocumentCount; + public int FieldCount => _diagnostics.FieldCount; + public Attempt IsHealthy() => _diagnostics.IsHealthy(); + public virtual IReadOnlyDictionary Metadata => _diagnostics.Metadata; #endregion } diff --git a/src/Umbraco.Examine/UmbracoExamineSearcher.cs b/src/Umbraco.Examine/UmbracoExamineSearcher.cs index b23d2bcb29..2474bc6429 100644 --- a/src/Umbraco.Examine/UmbracoExamineSearcher.cs +++ b/src/Umbraco.Examine/UmbracoExamineSearcher.cs @@ -137,7 +137,7 @@ namespace Umbraco.Examine var fields = base.GetAllIndexedFields(); return fields .Where(x => x != UmbracoExamineIndexer.IndexPathFieldName) - .Where(x => x != LuceneIndexer.ItemTypeFieldName) + .Where(x => x != LuceneIndex.ItemTypeFieldName) .ToArray(); } diff --git a/src/Umbraco.Examine/UmbracoMemberIndexer.cs b/src/Umbraco.Examine/UmbracoMemberIndexer.cs index 2b0d3a0c66..4943f49825 100644 --- a/src/Umbraco.Examine/UmbracoMemberIndexer.cs +++ b/src/Umbraco.Examine/UmbracoMemberIndexer.cs @@ -80,10 +80,10 @@ namespace Umbraco.Examine { base.OnTransformingIndexValues(e); - if (e.IndexItem.ValueSet.Values.TryGetValue("key", out var key) && e.IndexItem.ValueSet.Values.ContainsKey("__key") == false) + if (e.ValueSet.Values.TryGetValue("key", out var key) && e.ValueSet.Values.ContainsKey("__key") == false) { //double __ prefix means it will be indexed as culture invariant - e.IndexItem.ValueSet.Values["__key"] = key; + e.ValueSet.Values["__key"] = key; } } diff --git a/src/Umbraco.Tests/TestHelpers/Stubs/TestExamineManager.cs b/src/Umbraco.Tests/TestHelpers/Stubs/TestExamineManager.cs index f0abe053ac..ac5671fceb 100644 --- a/src/Umbraco.Tests/TestHelpers/Stubs/TestExamineManager.cs +++ b/src/Umbraco.Tests/TestHelpers/Stubs/TestExamineManager.cs @@ -6,10 +6,10 @@ namespace Umbraco.Tests.TestHelpers.Stubs { internal class TestExamineManager : IExamineManager { - private readonly ConcurrentDictionary _indexers = new ConcurrentDictionary(); + private readonly ConcurrentDictionary _indexers = new ConcurrentDictionary(); private readonly ConcurrentDictionary _searchers = new ConcurrentDictionary(); - public void AddIndexer(IIndexer indexer) + public void AddIndex(IIndex indexer) { _indexers.TryAdd(indexer.Name, indexer); } @@ -24,7 +24,7 @@ namespace Umbraco.Tests.TestHelpers.Stubs //noop } - public IIndexer GetIndexer(string indexerName) + public IIndex GetIndex(string indexerName) { return _indexers.TryGetValue(indexerName, out var indexer) ? indexer : null; } @@ -34,6 +34,6 @@ namespace Umbraco.Tests.TestHelpers.Stubs return _searchers.TryGetValue(searcherName, out var indexer) ? indexer : null; } - public IReadOnlyDictionary IndexProviders => _indexers; + public IReadOnlyDictionary IndexProviders => _indexers; } } diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index 5fa0cf3469..3b98e778e4 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -77,7 +77,7 @@ - + 1.8.9 diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs index 2132c9b19e..fe8732eeeb 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs @@ -167,12 +167,12 @@ namespace Umbraco.Tests.UmbracoExamine var protectedQuery = new BooleanQuery(); protectedQuery.Add( new BooleanClause( - new TermQuery(new Term(LuceneIndexer.CategoryFieldName, IndexTypes.Content)), + new TermQuery(new Term(LuceneIndex.CategoryFieldName, IndexTypes.Content)), Occur.MUST)); protectedQuery.Add( new BooleanClause( - new TermQuery(new Term(LuceneIndexer.ItemIdFieldName, ExamineDemoDataContentService.ProtectedNode.ToString())), + new TermQuery(new Term(LuceneIndex.ItemIdFieldName, ExamineDemoDataContentService.ProtectedNode.ToString())), Occur.MUST)); var collector = TopScoreDocCollector.Create(100, true); @@ -293,7 +293,7 @@ namespace Umbraco.Tests.UmbracoExamine //create the whole thing rebuilder.Populate(indexer); - var result = searcher.Search(searcher.CreateCriteria().Field(LuceneIndexer.CategoryFieldName, IndexTypes.Content).Compile()); + var result = searcher.Search(searcher.CreateCriteria().Field(LuceneIndex.CategoryFieldName, IndexTypes.Content).Compile()); Assert.AreEqual(21, result.TotalItemCount); //delete all content @@ -304,13 +304,13 @@ namespace Umbraco.Tests.UmbracoExamine //ensure it's all gone - result = searcher.Search(searcher.CreateCriteria().Field(LuceneIndexer.CategoryFieldName, IndexTypes.Content).Compile()); + result = searcher.Search(searcher.CreateCriteria().Field(LuceneIndex.CategoryFieldName, IndexTypes.Content).Compile()); Assert.AreEqual(0, result.TotalItemCount); //call our indexing methods rebuilder.Populate(indexer); - result = searcher.Search(searcher.CreateCriteria().Field(LuceneIndexer.CategoryFieldName, IndexTypes.Content).Compile()); + result = searcher.Search(searcher.CreateCriteria().Field(LuceneIndex.CategoryFieldName, IndexTypes.Content).Compile()); Assert.AreEqual(21, result.TotalItemCount); } } diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardintro.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardintro.html deleted file mode 100644 index 5b4bc988c0..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardintro.html +++ /dev/null @@ -1,14 +0,0 @@ -

Start here

-

This section contains the tools to add advanced features to your Umbraco site

-

From here you can explore and install packages, create macros, add data types, and much more. Start by exploring the below links or videos.

- -

Find out more:

- - diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/examinemanagement.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/examinemanagement.html index b5f1fd12ed..a64f69e345 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/examinemanagement.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/examinemanagement.html @@ -28,124 +28,48 @@
- +
-
- {{indexer.name}} -
- - {{indexer.name}} - -
+ +
The index cannot be read and will need to be rebuilt
+ + + {{indexer.name}} + +
-
-
- - -
-
- -
+
  • Index info & tools - -
    +

    -
    - +
    + +
    The process is taking longer than expected, check the umbraco log to see if there have been any errors during this operation
    - - - - - - - - - - -
     
    Documents in index{{indexer.documentCount}}
    Fields in index{{indexer.fieldCount}}
  • -
  • - Node types - - - - - - - - - - - - - -
    Include node types{{indexer.indexCriteria.IncludeNodeTypes | json}}
    Exclude node types{{indexer.indexCriteria.ExcludeNodeTypes | json}}
    Parent node id{{indexer.indexCriteria.ParentNodeId}}
    -
  • -
  • - System fields - - - - - - - - - - - - - - - - -
     
    NameEnable sortingType
    {{field.Name}}{{field.EnableSorting}}{{field.Type}}
    -
  • -
  • - User fields - - - - - - - - - - - - - - - - -
     
    NameEnable sortingType
    {{field.Name}}{{field.EnableSorting}}{{field.Type}}
    -
  • - Provider properties + Index properties diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index f33df18a54..a17168b42c 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -88,7 +88,7 @@ - + diff --git a/src/Umbraco.Web/Editors/ExamineManagementController.cs b/src/Umbraco.Web/Editors/ExamineManagementController.cs index ec6f1841b0..d54c67ddb7 100644 --- a/src/Umbraco.Web/Editors/ExamineManagementController.cs +++ b/src/Umbraco.Web/Editors/ExamineManagementController.cs @@ -121,7 +121,7 @@ namespace Umbraco.Web.Editors /// public ExamineIndexModel PostCheckRebuildIndex(string indexerName) { - var msg = ValidateLuceneIndexer(indexerName, out LuceneIndexer indexer); + var msg = ValidateLuceneIndexer(indexerName, out LuceneIndex indexer); if (msg.IsSuccessStatusCode) { var cacheKey = "temp_indexing_op_" + indexerName; @@ -130,7 +130,7 @@ namespace Umbraco.Web.Editors //if its still there then it's not done return found != null ? null - : CreateModel(new KeyValuePair(indexerName, indexer)); + : CreateModel(new KeyValuePair(indexerName, indexer)); } throw new HttpResponseException(msg); @@ -143,7 +143,7 @@ namespace Umbraco.Web.Editors /// public HttpResponseMessage PostRebuildIndex(string indexerName) { - var msg = ValidateLuceneIndexer(indexerName, out LuceneIndexer indexer); + var msg = ValidateLuceneIndexer(indexerName, out LuceneIndex indexer); if (msg.IsSuccessStatusCode) { _logger.Info("Rebuilding index '{IndexerName}'", indexerName); @@ -185,7 +185,7 @@ namespace Umbraco.Web.Editors - private ExamineIndexModel CreateModel(KeyValuePair indexerKeyVal) + private ExamineIndexModel CreateModel(KeyValuePair indexerKeyVal) { var indexer = indexerKeyVal.Value; var indexName = indexerKeyVal.Key; @@ -249,7 +249,7 @@ namespace Umbraco.Web.Editors } private HttpResponseMessage ValidateLuceneIndexer(string indexerName, out T indexer) - where T : class, IIndexer + where T : class, IIndex { indexer = null; @@ -270,7 +270,7 @@ namespace Umbraco.Web.Editors //static listener so it's not GC'd private void Indexer_IndexOperationComplete(object sender, EventArgs e) { - var indexer = (LuceneIndexer) sender; + var indexer = (LuceneIndex) sender; //ensure it's not listening anymore indexer.IndexOperationComplete -= Indexer_IndexOperationComplete; diff --git a/src/Umbraco.Web/ExamineStartup.cs b/src/Umbraco.Web/ExamineStartup.cs deleted file mode 100644 index f3a8bc3ef5..0000000000 --- a/src/Umbraco.Web/ExamineStartup.cs +++ /dev/null @@ -1,212 +0,0 @@ -// fixme - Examine is borked -// this cannot compile because it seems to require some changes that are not in Examine v2 -// this should *not* exist, see ExamineComponent instead, which handles everything about Examine - -//using System; -//using System.Collections.Generic; -//using System.Linq; -//using Examine; -//using Examine.Config; -//using Examine.LuceneEngine; -//using Examine.LuceneEngine.Providers; -//using Examine.Providers; -//using Lucene.Net.Index; -//using Lucene.Net.Store; -//using Umbraco.Core; -//using Umbraco.Core.Logging; -//using UmbracoExamine; - -//namespace Umbraco.Web -//{ -// /// -// /// Used to configure Examine during startup for the web application -// /// -// internal class ExamineStartup -// { -// private readonly List _indexesToRebuild = new List(); -// private readonly ApplicationContext _appCtx; -// private readonly ProfilingLogger _profilingLogger; -// private static bool _isConfigured = false; - -// //this is used if we are not the MainDom, in which case we need to ensure that if indexes need rebuilding that this -// //doesn't occur since that should only occur when we are MainDom -// private bool _disableExamineIndexing = false; - -// public ExamineStartup(ApplicationContext appCtx) -// { -// _appCtx = appCtx; -// _profilingLogger = appCtx.ProfilingLogger; -// } - -// /// -// /// Called during the initialize operation of the boot manager process -// /// -// public void Initialize() -// { -// //We want to manage Examine's appdomain shutdown sequence ourselves so first we'll disable Examine's default behavior -// //and then we'll use MainDom to control Examine's shutdown -// ExamineManager.DisableDefaultHostingEnvironmentRegistration(); - -// //we want to tell examine to use a different fs lock instead of the default NativeFSFileLock which could cause problems if the appdomain -// //terminates and in some rare cases would only allow unlocking of the file if IIS is forcefully terminated. Instead we'll rely on the simplefslock -// //which simply checks the existence of the lock file -// DirectoryTracker.DefaultLockFactory = d => -// { -// var simpleFsLockFactory = new NoPrefixSimpleFsLockFactory(d); -// return simpleFsLockFactory; -// }; - -// //This is basically a hack for this item: http://issues.umbraco.org/issue/U4-5976 -// // when Examine initializes it will try to rebuild if the indexes are empty, however in many cases not all of Examine's -// // event handlers will be assigned during bootup when the rebuilding starts which is a problem. So with the examine 0.1.58.2941 build -// // it has an event we can subscribe to in order to cancel this rebuilding process, but what we'll do is cancel it and postpone the rebuilding until the -// // boot process has completed. It's a hack but it works. -// ExamineManager.Instance.BuildingEmptyIndexOnStartup += OnInstanceOnBuildingEmptyIndexOnStartup; - -// //let's deal with shutting down Examine with MainDom -// var examineShutdownRegistered = _appCtx.MainDom.Register(() => -// { -// using (_profilingLogger.TraceDuration("Examine shutting down")) -// { -// //Due to the way Examine's own IRegisteredObject works, we'll first run it with immediate=false and then true so that -// //it's correct subroutines are executed (otherwise we'd have to run this logic manually ourselves) -// ExamineManager.Instance.Stop(false); -// ExamineManager.Instance.Stop(true); -// } -// }); -// if (examineShutdownRegistered) -// { -// _profilingLogger.Logger.Debug("Examine shutdown registered with MainDom"); -// } -// else -// { -// _profilingLogger.Logger.Debug("Examine shutdown not registered, this appdomain is not the MainDom"); - -// //if we could not register the shutdown examine ourselves, it means we are not maindom! in this case all of examine should be disabled -// //from indexing anything on startup!! -// _disableExamineIndexing = true; -// Suspendable.ExamineEvents.SuspendIndexers(); -// } -// } - -// /// -// /// Called during the Complete operation of the boot manager process -// /// -// public void Complete() -// { -// EnsureUnlockedAndConfigured(); - -// //Ok, now that everything is complete we'll check if we've stored any references to index that need rebuilding and run them -// // (see the initialize method for notes) - we'll ensure we remove the event handler too in case examine manager doesn't actually -// // initialize during startup, in which case we want it to rebuild the indexes itself. -// ExamineManager.Instance.BuildingEmptyIndexOnStartup -= OnInstanceOnBuildingEmptyIndexOnStartup; - -// //don't do anything if we have disabled this -// if (_disableExamineIndexing == false) -// { -// foreach (var indexer in _indexesToRebuild) -// { -// indexer.RebuildIndex(); -// } -// } -// } - -// /// -// /// Called to perform the rebuilding indexes on startup if the indexes don't exist -// /// -// public void RebuildIndexes() -// { -// //don't do anything if we have disabled this -// if (_disableExamineIndexing) return; - -// EnsureUnlockedAndConfigured(); - -// //If the developer has explicitly opted out of rebuilding indexes on startup then we -// // should adhere to that and not do it, this means that if they are load balancing things will be -// // out of sync if they are auto-scaling but there's not much we can do about that. -// if (ExamineSettings.Instance.RebuildOnAppStart == false) return; - -// foreach (var indexer in GetIndexesForColdBoot()) -// { -// indexer.RebuildIndex(); -// } -// } - -// /// -// /// The method used to create indexes on a cold boot -// /// -// /// -// /// A cold boot is when the server determines it will not (or cannot) process instructions in the cache table and -// /// will rebuild it's own caches itself. -// /// -// public IEnumerable GetIndexesForColdBoot() -// { -// // NOTE: This is IMPORTANT! ... we don't want to rebuild any index that is already flagged to be re-indexed -// // on startup based on our _indexesToRebuild variable and how Examine auto-rebuilds when indexes are empty. -// // This callback is used above for the DatabaseServerMessenger startup options. - -// // all indexes -// IEnumerable indexes = ExamineManager.Instance.IndexProviderCollection; - -// // except those that are already flagged -// // and are processed in Complete() -// if (_indexesToRebuild.Any()) -// indexes = indexes.Except(_indexesToRebuild); - -// // return -// foreach (var index in indexes) -// yield return index; -// } - -// /// -// /// Must be called to configure each index and ensure it's unlocked before any indexing occurs -// /// -// /// -// /// Indexing rebuilding can occur on a normal boot if the indexes are empty or on a cold boot by the database server messenger. Before -// /// either of these happens, we need to configure the indexes. -// /// -// private void EnsureUnlockedAndConfigured() -// { -// if (_isConfigured) return; - -// _isConfigured = true; - -// foreach (var luceneIndexer in ExamineManager.Instance.IndexProviderCollection.OfType()) -// { -// //We now need to disable waiting for indexing for Examine so that the appdomain is shutdown immediately and doesn't wait for pending -// //indexing operations. We used to wait for indexing operations to complete but this can cause more problems than that is worth because -// //that could end up halting shutdown for a very long time causing overlapping appdomains and many other problems. -// luceneIndexer.WaitForIndexQueueOnShutdown = false; - -// //we should check if the index is locked ... it shouldn't be! We are using simple fs lock now and we are also ensuring that -// //the indexes are not operational unless MainDom is true so if _disableExamineIndexing is false then we should be in charge -// if (_disableExamineIndexing == false) -// { -// var dir = luceneIndexer.GetLuceneDirectory(); -// if (IndexWriter.IsLocked(dir)) -// { -// _profilingLogger.Logger.Info("Forcing index " + luceneIndexer.IndexSetName + " to be unlocked since it was left in a locked state"); -// IndexWriter.Unlock(dir); -// } -// } -// } -// } - -// private void OnInstanceOnBuildingEmptyIndexOnStartup(object sender, BuildingEmptyIndexOnStartupEventArgs args) -// { -// //store the indexer that needs rebuilding because it's empty for when the boot process -// // is complete and cancel this current event so the rebuild process doesn't start right now. -// args.Cancel = true; -// _indexesToRebuild.Add((BaseIndexProvider)args.Indexer); - -// //check if the index is rebuilding due to an error and log it -// if (args.IsHealthy == false) -// { -// var baseIndex = args.Indexer as BaseIndexProvider; -// var name = baseIndex != null ? baseIndex.Name : "[UKNOWN]"; - -// _profilingLogger.Logger.Error(string.Format("The index {0} is rebuilding due to being unreadable/corrupt", name), args.UnhealthyException); -// } -// } -// } -//} diff --git a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs index 5d41c8cb0c..4028d480db 100644 --- a/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/EntityMapperProfile.cs @@ -136,9 +136,9 @@ namespace Umbraco.Web.Models.Mapping dest.Key = key; //need to set the UDI - if (src.Values.ContainsKey(LuceneIndexer.CategoryFieldName)) + if (src.Values.ContainsKey(LuceneIndex.CategoryFieldName)) { - switch (src.Values[LuceneIndexer.CategoryFieldName]) + switch (src.Values[LuceneIndex.CategoryFieldName]) { case IndexTypes.Member: dest.Udi = new GuidUdi(Constants.UdiEntityType.Member, dest.Key); @@ -168,9 +168,9 @@ namespace Umbraco.Web.Models.Mapping } dest.Path = src.Values.ContainsKey(UmbracoExamineIndexer.IndexPathFieldName) ? src.Values[UmbracoExamineIndexer.IndexPathFieldName] : ""; - if (src.Values.ContainsKey(LuceneIndexer.ItemTypeFieldName)) + if (src.Values.ContainsKey(LuceneIndex.ItemTypeFieldName)) { - dest.AdditionalData.Add("contentType", src.Values[LuceneIndexer.ItemTypeFieldName]); + dest.AdditionalData.Add("contentType", src.Values[LuceneIndex.ItemTypeFieldName]); } }); diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/DictionaryPublishedContent.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/DictionaryPublishedContent.cs index 49e0d1e9d2..7a8ce65ae3 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/DictionaryPublishedContent.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/DictionaryPublishedContent.cs @@ -57,7 +57,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache ValidateAndSetProperty(valueDictionary, val => _sortOrder = Int32.Parse(val), "sortOrder"); ValidateAndSetProperty(valueDictionary, val => _name = val, "nodeName", "__nodeName"); ValidateAndSetProperty(valueDictionary, val => _urlName = val, "urlName"); - ValidateAndSetProperty(valueDictionary, val => _documentTypeAlias = val, "nodeTypeAlias", LuceneIndexer.ItemTypeFieldName); + ValidateAndSetProperty(valueDictionary, val => _documentTypeAlias = val, "nodeTypeAlias", LuceneIndex.ItemTypeFieldName); ValidateAndSetProperty(valueDictionary, val => _documentTypeId = Int32.Parse(val), "nodeType"); //ValidateAndSetProperty(valueDictionary, val => _writerName = val, "writerName"); ValidateAndSetProperty(valueDictionary, val => _creatorName = val, "creatorName", "writerName"); //this is a bit of a hack fix for: U4-1132 diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs index d334c6ab48..45f32353da 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs @@ -38,7 +38,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // method GetExamineManagerSafe(). // private readonly ISearcher _searchProvider; - private readonly IIndexer _indexProvider; + private readonly IIndex _indexProvider; private readonly XmlStore _xmlStore; private readonly PublishedContentTypeCache _contentTypeCache; diff --git a/src/Umbraco.Web/PublishedContentQuery.cs b/src/Umbraco.Web/PublishedContentQuery.cs index 363607fbcb..8ad40887cc 100644 --- a/src/Umbraco.Web/PublishedContentQuery.cs +++ b/src/Umbraco.Web/PublishedContentQuery.cs @@ -234,8 +234,8 @@ namespace Umbraco.Web if (_query != null) return _query.Search(skip, take, out totalRecords, term, useWildCards, indexName); var indexer = string.IsNullOrEmpty(indexName) - ? Examine.ExamineManager.Instance.GetIndexer(Constants.Examine.ExternalIndexer) - : Examine.ExamineManager.Instance.GetIndexer(indexName); + ? Examine.ExamineManager.Instance.GetIndex(Constants.Examine.ExternalIndexer) + : Examine.ExamineManager.Instance.GetIndex(indexName); if (indexer == null) throw new InvalidOperationException("No index found by name " + indexName); @@ -278,7 +278,7 @@ namespace Umbraco.Web /// /// Creates an ISearchCriteria for searching all fields in a . /// - private ISearchCriteria SearchAllFields(string searchText, bool useWildcards, Examine.ISearcher searcher, Examine.IIndexer indexer) + private ISearchCriteria SearchAllFields(string searchText, bool useWildcards, Examine.ISearcher searcher, Examine.IIndex indexer) { var sc = searcher.CreateCriteria(); diff --git a/src/Umbraco.Web/Search/ExamineComponent.cs b/src/Umbraco.Web/Search/ExamineComponent.cs index a7c7bf8dae..9c659582ea 100644 --- a/src/Umbraco.Web/Search/ExamineComponent.cs +++ b/src/Umbraco.Web/Search/ExamineComponent.cs @@ -113,7 +113,7 @@ namespace Umbraco.Web.Search //create the indexes and register them with the manager foreach(var index in indexBuilder.Create()) { - _examineManager.AddIndexer(index); + _examineManager.AddIndex(index); } profilingLogger.Logger.Debug("Examine shutdown registered with MainDom"); @@ -192,7 +192,7 @@ namespace Umbraco.Web.Search _isConfigured = true; - foreach (var luceneIndexer in examineManager.IndexProviders.Values.OfType()) + foreach (var luceneIndexer in examineManager.IndexProviders.Values.OfType()) { //We now need to disable waiting for indexing for Examine so that the appdomain is shutdown immediately and doesn't wait for pending //indexing operations. We used to wait for indexing operations to complete but this can cause more problems than that is worth because diff --git a/src/Umbraco.Web/Search/ExamineIndexModel.cs b/src/Umbraco.Web/Search/ExamineIndexModel.cs index 1851e696f4..aa4c84ce9b 100644 --- a/src/Umbraco.Web/Search/ExamineIndexModel.cs +++ b/src/Umbraco.Web/Search/ExamineIndexModel.cs @@ -14,6 +14,9 @@ namespace Umbraco.Web.Search [DataMember(Name = "healthStatus")] public string HealthStatus { get; set; } + [DataMember(Name = "isHealthy")] + public bool IsHealthy => false; + [DataMember(Name = "providerProperties")] public IReadOnlyDictionary ProviderProperties { get; set; } diff --git a/src/Umbraco.Web/Search/GenericIndexDiagnostics.cs b/src/Umbraco.Web/Search/GenericIndexDiagnostics.cs index 6d3482837e..32c8d43575 100644 --- a/src/Umbraco.Web/Search/GenericIndexDiagnostics.cs +++ b/src/Umbraco.Web/Search/GenericIndexDiagnostics.cs @@ -13,10 +13,10 @@ namespace Umbraco.Web.Search /// public class GenericIndexDiagnostics : IIndexDiagnostics { - private readonly IIndexer _index; + private readonly IIndex _index; private static readonly string[] IgnoreProperties = { "Description" }; - public GenericIndexDiagnostics(IIndexer index) + public GenericIndexDiagnostics(IIndex index) { _index = index; } diff --git a/src/Umbraco.Web/Search/IUmbracoIndexesBuilder.cs b/src/Umbraco.Web/Search/IUmbracoIndexesBuilder.cs index 8193117d69..ec8d923abc 100644 --- a/src/Umbraco.Web/Search/IUmbracoIndexesBuilder.cs +++ b/src/Umbraco.Web/Search/IUmbracoIndexesBuilder.cs @@ -5,6 +5,6 @@ namespace Umbraco.Web.Search { internal interface IUmbracoIndexesBuilder { - IEnumerable Create(); + IEnumerable Create(); } } diff --git a/src/Umbraco.Web/Search/UmbracoIndexesBuilder.cs b/src/Umbraco.Web/Search/UmbracoIndexesBuilder.cs index fbe4d618e6..18ea85162c 100644 --- a/src/Umbraco.Web/Search/UmbracoIndexesBuilder.cs +++ b/src/Umbraco.Web/Search/UmbracoIndexesBuilder.cs @@ -45,7 +45,7 @@ namespace Umbraco.Web.Search /// Creates the Umbraco indexes /// /// - public IEnumerable Create() + public IEnumerable Create() { return new [] { @@ -55,7 +55,7 @@ namespace Umbraco.Web.Search }; } - private IIndexer CreateInternalIndex() + private IIndex CreateInternalIndex() { var index = new UmbracoContentIndexer( Constants.UmbracoIndexes.InternalIndexName, @@ -69,7 +69,7 @@ namespace Umbraco.Web.Search return index; } - private IIndexer CreateExternalIndex() + private IIndex CreateExternalIndex() { var index = new UmbracoContentIndexer( Constants.UmbracoIndexes.ExternalIndexName, @@ -83,7 +83,7 @@ namespace Umbraco.Web.Search return index; } - private IIndexer CreateMemberIndex() + private IIndex CreateMemberIndex() { var index = new UmbracoMemberIndexer( Constants.UmbracoIndexes.MembersIndexName, diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 3e54107759..90d9a58ef8 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -62,7 +62,7 @@ - + 2.6.2.25 @@ -219,7 +219,6 @@ -