Skip to content

Commit

Permalink
Removed ParentLink and ContentReference. Breaking for commerce conten…
Browse files Browse the repository at this point in the history
…t. Id and ParentId should be sufficient.
  • Loading branch information
NCG\oyvind.tanum committed Feb 2, 2023
1 parent 07cbd43 commit 1ca0cd3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,16 +409,8 @@ private static void AppendDefaultFields(IContent content, IDictionary<string, ob
dictionary.Add(DefaultFields.Id, content.ContentLink.ID);
dictionary.Add(DefaultFields.Indexed, DateTime.Now);

if(content.ContentLink != null)
{
dictionary.Add(DefaultFields.ContentLink, content.ContentLink);
}

if(content.ParentLink != null)
{
if(content.ParentLink != null)
dictionary.Add(DefaultFields.ParentId, content.ParentLink.ID);
dictionary.Add(DefaultFields.ParentLink, content.ParentLink);
}

dictionary.Add(DefaultFields.Name, content.Name);
dictionary.Add(DefaultFields.Type, typeName);
Expand Down
2 changes: 0 additions & 2 deletions src/Epinova.ElasticSearch.Core/DefaultFields.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ public static class DefaultFields
public const string Id = "Id";
public const string Indexed = "Indexed";
public const string ParentId = "ParentId";
public const string ContentLink = "ContentLink";
public const string ParentLink = "ParentLink";
public const string Name = "Name";
public const string Type = "Type";
public const string Types = "Types";
Expand Down
2 changes: 0 additions & 2 deletions src/Epinova.ElasticSearch.Core/Engine/QueryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ private void SetupSourceFields(QueryRequest request, QuerySetup setup)

fields.Add(DefaultFields.Id);
fields.Add(DefaultFields.Indexed);
fields.Add(DefaultFields.ContentLink);
fields.Add(DefaultFields.ParentLink);
fields.Add(DefaultFields.ParentId);
fields.Add(DefaultFields.Name);
fields.Add(DefaultFields.Type);
Expand Down
4 changes: 2 additions & 2 deletions src/Epinova.ElasticSearch.Core/WellKnownProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ internal static class WellKnownProperties
DefaultFields.Id,
DefaultFields.BestBets,
DefaultFields.ParentId,
DefaultFields.ContentLink,
DefaultFields.ParentLink,
DefaultFields.Path,
DefaultFields.Name,
DefaultFields.Lang,
Expand All @@ -35,10 +33,12 @@ internal static class WellKnownProperties
{
"CreatedBy",
"ChangedBy",
"ContentLink",
"DeletedBy",
"URLSegment",
"ExternalURL",
"PageName",
"ParentLink",
"RouteSegment",
"LinkURL",
"StaticLinkURL",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public void AsIndexItem_SetsStandardFields(string propName, object expectedValue
}

[Fact]
public void AsIndexItem_SetsStandardFields_ParentLink()
public void AsIndexItem_SetsStandardFields_ParentId()
{
dynamic result = _content.AsIndexItem();
var dictionary = (IDictionary<string, object>)result;

Assert.Equal(new PageReference(200), dictionary[DefaultFields.ParentLink]);
Assert.Equal(200, dictionary[DefaultFields.ParentId]);
}

[Fact]
Expand Down Expand Up @@ -80,7 +80,7 @@ public void AsIndexItem_SetsTypeHierarchy()
[InlineData(DefaultFields.Name)]
[InlineData(DefaultFields.Type)]
[InlineData(DefaultFields.Types)]
[InlineData(DefaultFields.ParentLink)]
[InlineData(DefaultFields.ParentId)]
[InlineData(DefaultFields.StartPublish)]
[InlineData(DefaultFields.StopPublish)]
[InlineData(DefaultFields.Path)]
Expand Down

0 comments on commit 1ca0cd3

Please sign in to comment.