rename to UmbracoTreeSearcherFields
This commit is contained in:
@@ -73,7 +73,7 @@ namespace Umbraco.Web.Runtime
|
||||
// register accessors for cultures
|
||||
composition.RegisterUnique<IDefaultCultureAccessor, DefaultCultureAccessor>();
|
||||
composition.RegisterUnique<IVariationContextAccessor, HybridVariationContextAccessor>();
|
||||
|
||||
|
||||
// register the http context and umbraco context accessors
|
||||
// we *should* use the HttpContextUmbracoContextAccessor, however there are cases when
|
||||
// we have no http context, eg when booting Umbraco or in background threads, so instead
|
||||
@@ -95,7 +95,7 @@ namespace Umbraco.Web.Runtime
|
||||
// a way to inject the UmbracoContext - DO NOT register this as Lifetime.Request since LI will dispose the context
|
||||
// in it's own way but we don't want that to happen, we manage its lifetime ourselves.
|
||||
composition.Register(factory => factory.GetInstance<IUmbracoContextAccessor>().UmbracoContext);
|
||||
composition.RegisterUnique<IInternalSearchConstants, InternalSearchConstants>();
|
||||
composition.RegisterUnique<IUmbracoTreeSearcherFields, UmbracoTreeSearcherFields>();
|
||||
composition.Register<IPublishedContentQuery>(factory =>
|
||||
{
|
||||
var umbCtx = factory.GetInstance<IUmbracoContextAccessor>();
|
||||
@@ -268,7 +268,7 @@ namespace Umbraco.Web.Runtime
|
||||
.Append<Issuu>()
|
||||
.Append<Hulu>()
|
||||
.Append<Giphy>();
|
||||
|
||||
|
||||
|
||||
// replace with web implementation
|
||||
composition.RegisterUnique<IPublishedSnapshotRebuilder, Migrations.PostMigrations.PublishedSnapshotRebuilder>();
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Web.Search
|
||||
{
|
||||
public interface IInternalSearchConstants
|
||||
public interface IUmbracoTreeSearcherFields
|
||||
{
|
||||
IEnumerable<string> GetBackOfficeFields();
|
||||
IEnumerable<string> GetBackOfficeMembersFields();
|
||||
@@ -28,7 +28,7 @@ namespace Umbraco.Web.Search
|
||||
private readonly IEntityService _entityService;
|
||||
private readonly UmbracoMapper _mapper;
|
||||
private readonly ISqlContext _sqlContext;
|
||||
private readonly IInternalSearchConstants _internalSearchConstants;
|
||||
private readonly IUmbracoTreeSearcherFields _umbracoTreeSearcherFields;
|
||||
|
||||
|
||||
public UmbracoTreeSearcher(IExamineManager examineManager,
|
||||
@@ -36,7 +36,7 @@ namespace Umbraco.Web.Search
|
||||
ILocalizationService languageService,
|
||||
IEntityService entityService,
|
||||
UmbracoMapper mapper,
|
||||
ISqlContext sqlContext,IInternalSearchConstants internalSearchConstants)
|
||||
ISqlContext sqlContext,IUmbracoTreeSearcherFields umbracoTreeSearcherFields)
|
||||
{
|
||||
_examineManager = examineManager ?? throw new ArgumentNullException(nameof(examineManager));
|
||||
_umbracoContext = umbracoContext;
|
||||
@@ -44,7 +44,7 @@ namespace Umbraco.Web.Search
|
||||
_entityService = entityService;
|
||||
_mapper = mapper;
|
||||
_sqlContext = sqlContext;
|
||||
_internalSearchConstants = internalSearchConstants;
|
||||
_umbracoTreeSearcherFields = umbracoTreeSearcherFields;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -70,7 +70,7 @@ namespace Umbraco.Web.Search
|
||||
|
||||
string type;
|
||||
var indexName = Constants.UmbracoIndexes.InternalIndexName;
|
||||
var fields = _internalSearchConstants.GetBackOfficeFields();
|
||||
var fields = _umbracoTreeSearcherFields.GetBackOfficeFields();
|
||||
|
||||
// TODO: WE should try to allow passing in a lucene raw query, however we will still need to do some manual string
|
||||
// manipulation for things like start paths, member types, etc...
|
||||
@@ -90,7 +90,7 @@ namespace Umbraco.Web.Search
|
||||
case UmbracoEntityTypes.Member:
|
||||
indexName = Constants.UmbracoIndexes.MembersIndexName;
|
||||
type = "member";
|
||||
fields.AddRange(_internalSearchConstants.GetBackOfficeMembersFields());
|
||||
fields.AddRange(_umbracoTreeSearcherFields.GetBackOfficeMembersFields());
|
||||
if (searchFrom != null && searchFrom != Constants.Conventions.MemberTypes.AllMembersListId && searchFrom.Trim() != "-1")
|
||||
{
|
||||
sb.Append("+__NodeTypeAlias:");
|
||||
@@ -100,13 +100,13 @@ namespace Umbraco.Web.Search
|
||||
break;
|
||||
case UmbracoEntityTypes.Media:
|
||||
type = "media";
|
||||
fields.AddRange(_internalSearchConstants.GetBackOfficeMediaFields());
|
||||
fields.AddRange(_umbracoTreeSearcherFields.GetBackOfficeMediaFields());
|
||||
var allMediaStartNodes = _umbracoContext.Security.CurrentUser.CalculateMediaStartNodeIds(_entityService);
|
||||
AppendPath(sb, UmbracoObjectTypes.Media, allMediaStartNodes, searchFrom, ignoreUserStartNodes, _entityService);
|
||||
break;
|
||||
case UmbracoEntityTypes.Document:
|
||||
type = "content";
|
||||
fields.AddRange(_internalSearchConstants.GetBackOfficeDocumentFields());
|
||||
fields.AddRange(_umbracoTreeSearcherFields.GetBackOfficeDocumentFields());
|
||||
var allContentStartNodes = _umbracoContext.Security.CurrentUser.CalculateContentStartNodeIds(_entityService);
|
||||
AppendPath(sb, UmbracoObjectTypes.Document, allContentStartNodes, searchFrom, ignoreUserStartNodes, _entityService);
|
||||
break;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Umbraco.Web.Search;
|
||||
|
||||
namespace Umbraco.Web
|
||||
{
|
||||
public class InternalSearchConstants : IInternalSearchConstants
|
||||
public class UmbracoTreeSearcherFields : IUmbracoTreeSearcherFields
|
||||
{
|
||||
private IReadOnlyList<string> _backOfficeFields = new List<string> {"id", "__NodeId", "__Key"};
|
||||
public IEnumerable<string> GetBackOfficeFields()
|
||||
Reference in New Issue
Block a user