Skip to content

Commit 8b18a95

Browse files
committed
Merge pull request #1698 from jweber/master
Added Parent and Routing fields to the Hit class
2 parents 5fb9afc + 1e61ac8 commit 8b18a95

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Nest/CommonAbstractions/SerializationBehavior/StatefulDeserialization/ConcreteTypeConverter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ internal static Type GetConcreteTypeUsingSelector<T>(
126126
hitDynamic.Type = d._type;
127127
hitDynamic.Version = d._version;
128128
hitDynamic.Id = d._id;
129+
hitDynamic.Parent = d._parent;
130+
hitDynamic.Routing = d._routing;
129131
hitDynamic.Sorts = d.sort;
130132
hitDynamic._Highlight = d.highlight is Dictionary<string, List<string>> ? d.highlight : null;
131133
hitDynamic.Explanation = d._explanation is Explanation ? d._explanation : null;

src/Nest/Search/Search/Hits/Hit.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public interface IHit<out T> where T : class
1414
long? Version { get; }
1515
double Score { get; }
1616
string Id { get; }
17+
string Parent { get; }
18+
string Routing { get; }
1719
IEnumerable<object> Sorts { get; }
1820
HighlightFieldDictionary Highlights { get; }
1921
Explanation Explanation { get; }
@@ -50,6 +52,12 @@ public class Hit<T> : IHit<T>
5052
[JsonProperty(PropertyName = "_id")]
5153
public string Id { get; internal set; }
5254

55+
[JsonProperty(PropertyName = "_parent")]
56+
public string Parent { get; internal set; }
57+
58+
[JsonProperty(PropertyName = "_routing")]
59+
public string Routing { get; internal set; }
60+
5361
[JsonProperty(PropertyName = "sort")]
5462
public IEnumerable<object> Sorts { get; internal set; }
5563

0 commit comments

Comments
 (0)