Create Interface for Member and Content Index to use in Populators

This commit is contained in:
arkadiuszbiel
2019-10-24 09:55:41 +01:00
parent 0c5b832627
commit ffaf12c548
7 changed files with 28 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ namespace Umbraco.Examine
/// <summary>
/// Performs the data lookups required to rebuild a content index
/// </summary>
public class ContentIndexPopulator : IndexPopulator<UmbracoContentIndex>
public class ContentIndexPopulator : IndexPopulator<IUmbracoContentIndex>
{
private readonly IContentService _contentService;
private readonly IValueSetBuilder<IContent> _contentValueSetBuilder;
@@ -36,7 +36,7 @@ namespace Umbraco.Examine
/// <param name="contentValueSetBuilder"></param>
public ContentIndexPopulator(IContentService contentService, ISqlContext sqlContext, IContentValueSetBuilder contentValueSetBuilder)
: this(false, null, contentService, sqlContext, contentValueSetBuilder)
{
{
}
/// <summary>

View File

@@ -0,0 +1,9 @@
using Examine;
namespace Umbraco.Examine
{
public interface IUmbracoContentIndex : IIndex
{
}
}

View File

@@ -0,0 +1,9 @@
using Examine;
namespace Umbraco.Examine
{
public interface IUmbracoMemberIndex : IIndex
{
}
}

View File

@@ -7,7 +7,7 @@ using Umbraco.Core.Services;
namespace Umbraco.Examine
{
public class MemberIndexPopulator : IndexPopulator<UmbracoMemberIndex>
public class MemberIndexPopulator : IndexPopulator<IUmbracoMemberIndex>
{
private readonly IMemberService _memberService;
private readonly IValueSetBuilder<IMember> _valueSetBuilder;

View File

@@ -64,10 +64,12 @@
<Compile Include="ExamineExtensions.cs" />
<Compile Include="IContentValueSetBuilder.cs" />
<Compile Include="IContentValueSetValidator.cs" />
<Compile Include="IUmbracoContentIndex.cs" />
<Compile Include="IUmbracoIndexConfig.cs" />
<Compile Include="IIndexCreator.cs" />
<Compile Include="IIndexDiagnostics.cs" />
<Compile Include="IIndexPopulator.cs" />
<Compile Include="IUmbracoMemberIndex.cs" />
<Compile Include="UmbracoIndexConfig.cs" />
<Compile Include="IndexPopulator.cs" />
<Compile Include="IndexRebuilder.cs" />

View File

@@ -17,13 +17,13 @@ namespace Umbraco.Examine
/// <summary>
/// An indexer for Umbraco content and media
/// </summary>
public class UmbracoContentIndex : UmbracoExamineIndex
public class UmbracoContentIndex : UmbracoExamineIndex, IUmbracoContentIndex
{
public const string VariesByCultureFieldName = SpecialFieldPrefix + "VariesByCulture";
protected ILocalizationService LanguageService { get; }
#region Constructors
/// <summary>
/// Create an index at runtime
/// </summary>
@@ -141,6 +141,6 @@ namespace Umbraco.Examine
base.PerformDeleteFromIndex(idsAsList, onComplete);
}
}
}

View File

@@ -11,7 +11,7 @@ namespace Umbraco.Examine
/// <summary>
/// Custom indexer for members
/// </summary>
public class UmbracoMemberIndex : UmbracoExamineIndex
public class UmbracoMemberIndex : UmbracoExamineIndex, IUmbracoMemberIndex
{
/// <summary>
/// Constructor to allow for creating an indexer at runtime
@@ -32,6 +32,6 @@ namespace Umbraco.Examine
base(name, luceneDirectory, fieldDefinitions, analyzer, profilingLogger, validator)
{
}
}
}