@@ -28,7 +28,8 @@ public interface ISearchResponse<out TDocument> : IResponse where TDocument : cl
28
28
ClusterStatistics Clusters { get ; }
29
29
30
30
/// <summary>
31
- /// Gets the documents inside the hits, by deserializing <see cref="IHitMetadata{T}.Source" /> into <typeparamref name="TDocument" />
31
+ /// Gets the documents inside the hits, by deserializing <see cref="IHitMetadata{T}.Source" /> into
32
+ /// <typeparamref name="TDocument" />
32
33
/// <para>
33
34
/// NOTE: if you use <see cref="ISearchRequest.StoredFields" /> on the search request,
34
35
/// <see cref="Documents" /> will be empty and you should use <see cref="Fields" />
@@ -68,6 +69,11 @@ public interface ISearchResponse<out TDocument> : IResponse where TDocument : cl
68
69
/// </summary>
69
70
long NumberOfReducePhases { get ; }
70
71
72
+ /// <summary>
73
+ /// When a search is made over a point in time, this will be the ID of the point in time.
74
+ /// </summary>
75
+ string PointInTimeId { get ; }
76
+
71
77
/// <summary>
72
78
/// Gets the results of profiling the search query. Has a value only when
73
79
/// <see cref="ISearchRequest.Profile" /> is set to <c>true</c> on the search request.
@@ -110,11 +116,6 @@ public interface ISearchResponse<out TDocument> : IResponse where TDocument : cl
110
116
/// Gets the total number of documents matching the search query criteria
111
117
/// </summary>
112
118
long Total { get ; }
113
-
114
- /// <summary>
115
- /// When a search is made over a point in time, this will be the ID of the point in time.
116
- /// </summary>
117
- string PointInTimeId { get ; }
118
119
}
119
120
120
121
public class SearchResponse < TDocument > : ResponseBase , ISearchResponse < TDocument > where TDocument : class
@@ -126,7 +127,7 @@ public class SearchResponse<TDocument> : ResponseBase, ISearchResponse<TDocument
126
127
private IReadOnlyCollection < IHit < TDocument > > _hits ;
127
128
128
129
/// <inheritdoc />
129
- [ DataMember ( Name = "aggregations" ) ]
130
+ [ DataMember ( Name = "aggregations" ) ]
130
131
public AggregateDictionary Aggregations { get ; internal set ; } = AggregateDictionary . Default ;
131
132
132
133
/// <inheritdoc />
@@ -153,51 +154,51 @@ public class SearchResponse<TDocument> : ResponseBase, ISearchResponse<TDocument
153
154
_hits ?? ( _hits = HitsMetadata ? . Hits ?? EmptyReadOnly < IHit < TDocument > > . Collection ) ;
154
155
155
156
/// <inheritdoc />
156
- [ DataMember ( Name = "hits" ) ]
157
+ [ DataMember ( Name = "hits" ) ]
157
158
public IHitsMetadata < TDocument > HitsMetadata { get ; internal set ; }
158
159
159
160
/// <inheritdoc />
160
161
[ IgnoreDataMember ]
161
162
public double MaxScore => HitsMetadata ? . MaxScore ?? 0 ;
162
163
163
164
/// <inheritdoc />
164
- [ DataMember ( Name = "num_reduce_phases" ) ]
165
+ [ DataMember ( Name = "num_reduce_phases" ) ]
165
166
public long NumberOfReducePhases { get ; internal set ; }
166
167
167
168
/// <inheritdoc />
168
- [ DataMember ( Name = "profile" ) ]
169
+ [ DataMember ( Name = "pit_id" ) ]
170
+ public string PointInTimeId { get ; internal set ; }
171
+
172
+ /// <inheritdoc />
173
+ [ DataMember ( Name = "profile" ) ]
169
174
public Profile Profile { get ; internal set ; }
170
175
171
176
/// <inheritdoc />
172
177
[ DataMember ( Name = "_scroll_id" ) ]
173
178
public string ScrollId { get ; internal set ; }
174
179
175
180
/// <inheritdoc />
176
- [ DataMember ( Name = "_shards" ) ]
181
+ [ DataMember ( Name = "_shards" ) ]
177
182
public ShardStatistics Shards { get ; internal set ; }
178
183
179
184
/// <inheritdoc />
180
- [ DataMember ( Name = "suggest" ) ]
185
+ [ DataMember ( Name = "suggest" ) ]
181
186
public ISuggestDictionary < TDocument > Suggest { get ; internal set ; } = SuggestDictionary < TDocument > . Default ;
182
187
183
188
/// <inheritdoc />
184
- [ DataMember ( Name = "terminated_early" ) ]
189
+ [ DataMember ( Name = "terminated_early" ) ]
185
190
public bool TerminatedEarly { get ; internal set ; }
186
191
187
192
/// <inheritdoc />
188
- [ DataMember ( Name = "timed_out" ) ]
193
+ [ DataMember ( Name = "timed_out" ) ]
189
194
public bool TimedOut { get ; internal set ; }
190
195
191
196
/// <inheritdoc />
192
- [ DataMember ( Name = "took" ) ]
197
+ [ DataMember ( Name = "took" ) ]
193
198
public long Took { get ; internal set ; }
194
199
195
200
/// <inheritdoc />
196
201
[ IgnoreDataMember ]
197
- public long Total => HitsMetadata ? . Total . Value ?? - 1 ;
198
-
199
- /// <inheritdoc />
200
- [ DataMember ( Name = "pit_id" ) ]
201
- public string PointInTimeId { get ; internal set ; }
202
+ public long Total => HitsMetadata ? . Total ? . Value ?? - 1 ;
202
203
}
203
204
}
0 commit comments