Skip to content

Commit 1e61ac8

Browse files
committed
Added Parent and Routing fields to the Hit class
1 parent 1653341 commit 1e61ac8

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
@@ -171,6 +171,8 @@ internal static Type GetConcreteTypeUsingSelector<T>(
171171
hitDynamic.Type = d._type;
172172
hitDynamic.Version = d._version;
173173
hitDynamic.Id = d._id;
174+
hitDynamic.Parent = d._parent;
175+
hitDynamic.Routing = d._routing;
174176
hitDynamic.Sorts = d.sort;
175177
hitDynamic._Highlight = d.highlight is Dictionary<string, List<string>> ? d.highlight : null;
176178
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)