Adding a constant for the new field name

This commit is contained in:
Jeavon
2019-10-04 11:17:36 +01:00
parent 72147ab8f2
commit 68866e9faf
4 changed files with 5 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ namespace Umbraco.Examine
{"path", m.Path?.Yield() ?? Enumerable.Empty<string>()},
{"nodeType", m.ContentType.Id.ToString().Yield() },
{"creatorName", (m.GetCreatorProfile(_userService)?.Name ?? "??").Yield()},
{"__umbracoFile", new object[] {umbracoFile}}
{UmbracoExamineIndex.UmbracoFileFieldName, new object[] {umbracoFile}}
};
foreach (var property in m.Properties)

View File

@@ -32,6 +32,7 @@ namespace Umbraco.Examine
/// </summary>
public const string IndexPathFieldName = SpecialFieldPrefix + "Path";
public const string NodeKeyFieldName = SpecialFieldPrefix + "Key";
public const string UmbracoFileFieldName = SpecialFieldPrefix + "umbracoFile";
public const string IconFieldName = SpecialFieldPrefix + "Icon";
public const string PublishedFieldName = SpecialFieldPrefix + "Published";

View File

@@ -180,9 +180,9 @@ namespace Umbraco.Web.Models.Mapping
target.Name = source.Values.ContainsKey("nodeName") ? source.Values["nodeName"] : "[no name]";
if (source.Values.ContainsKey("__umbracoFile"))
if (source.Values.ContainsKey(UmbracoExamineIndex.UmbracoFileFieldName))
{
var umbracoFile = source.Values["__umbracoFile"];
var umbracoFile = source.Values[UmbracoExamineIndex.UmbracoFileFieldName];
if (umbracoFile != null)
{
target.Name = $"{target.Name} ({umbracoFile})";

View File

@@ -85,7 +85,7 @@ namespace Umbraco.Web.Search
break;
case UmbracoEntityTypes.Media:
type = "media";
fields = new[] { "__umbracoFile" };
fields = new[] { UmbracoExamineIndex.UmbracoFileFieldName };
var allMediaStartNodes = _umbracoContext.Security.CurrentUser.CalculateMediaStartNodeIds(_entityService);
AppendPath(sb, UmbracoObjectTypes.Media, allMediaStartNodes, searchFrom, ignoreUserStartNodes, _entityService);
break;