@@ -29,6 +29,9 @@ public partial interface ISearchRequest : ICovariantSearchRequest
29
29
[ JsonProperty ( PropertyName = "track_scores" ) ]
30
30
bool ? TrackScores { get ; set ; }
31
31
32
+ [ JsonProperty ( PropertyName = "profile" ) ]
33
+ bool ? Profile { get ; set ; }
34
+
32
35
[ JsonProperty ( PropertyName = "min_score" ) ]
33
36
double ? MinScore { get ; set ; }
34
37
@@ -101,6 +104,7 @@ public partial class SearchRequest
101
104
public bool ? Explain { get ; set ; }
102
105
public bool ? Version { get ; set ; }
103
106
public bool ? TrackScores { get ; set ; }
107
+ public bool ? Profile { get ; set ; }
104
108
public double ? MinScore { get ; set ; }
105
109
public long ? TerminateAfter { get ; set ; }
106
110
public Fields Fields { get ; set ; }
@@ -143,6 +147,7 @@ public partial class SearchRequest<T>
143
147
public bool ? Explain { get ; set ; }
144
148
public bool ? Version { get ; set ; }
145
149
public bool ? TrackScores { get ; set ; }
150
+ public bool ? Profile { get ; set ; }
146
151
public double ? MinScore { get ; set ; }
147
152
public long ? TerminateAfter { get ; set ; }
148
153
public Fields Fields { get ; set ; }
@@ -198,6 +203,7 @@ public partial class SearchDescriptor<T> where T : class
198
203
bool ? ISearchRequest . Explain { get ; set ; }
199
204
bool ? ISearchRequest . Version { get ; set ; }
200
205
bool ? ISearchRequest . TrackScores { get ; set ; }
206
+ bool ? ISearchRequest . Profile { get ; set ; }
201
207
double ? ISearchRequest . MinScore { get ; set ; }
202
208
long ? ISearchRequest . TerminateAfter { get ; set ; }
203
209
@@ -224,7 +230,7 @@ public SearchDescriptor<T> Source(Func<SourceFilterDescriptor<T>, ISourceFilter>
224
230
Assign ( a => a . Source = sourceSelector ? . Invoke ( new SourceFilterDescriptor < T > ( ) ) ) ;
225
231
226
232
/// <summary>
227
- /// The number of hits to return. Defaults to 10. When using scroll search type
233
+ /// The number of hits to return. Defaults to 10. When using scroll search type
228
234
/// size is actually multiplied by the number of shards!
229
235
/// </summary>
230
236
public SearchDescriptor < T > Size ( int size ) => Assign ( a => a . Size = size ) ;
@@ -245,14 +251,14 @@ public SearchDescriptor<T> Source(Func<SourceFilterDescriptor<T>, ISourceFilter>
245
251
public SearchDescriptor < T > Skip ( int skip ) => this . From ( skip ) ;
246
252
247
253
/// <summary>
248
- /// A search timeout, bounding the search request to be executed within the
254
+ /// A search timeout, bounding the search request to be executed within the
249
255
/// specified time value and bail with the hits accumulated up
250
256
/// to that point when expired. Defaults to no timeout.
251
257
/// </summary>
252
258
public SearchDescriptor < T > Timeout ( string timeout ) => Assign ( a => a . Timeout = timeout ) ;
253
259
254
260
/// <summary>
255
- /// Enables explanation for each hit on how its score was computed.
261
+ /// Enables explanation for each hit on how its score was computed.
256
262
/// (Use .DocumentsWithMetaData on the return results)
257
263
/// </summary>
258
264
public SearchDescriptor < T > Explain ( bool explain = true ) => Assign ( a => a . Explain = explain ) ;
@@ -267,20 +273,27 @@ public SearchDescriptor<T> Source(Func<SourceFilterDescriptor<T>, ISourceFilter>
267
273
/// </summary>
268
274
public SearchDescriptor < T > TrackScores ( bool trackscores = true ) => Assign ( a => a . TrackScores = trackscores ) ;
269
275
276
+ /// <summary>
277
+ /// The Profile API provides detailed timing information about the execution of individual components in a query.
278
+ /// It gives the user insight into how queries are executed at a low level so that the user can understand
279
+ /// why certain queries are slow, and take steps to improve their slow queries.
280
+ /// </summary>
281
+ public SearchDescriptor < T > Profile ( bool profile = true ) => Assign ( a => a . Profile = profile ) ;
282
+
270
283
/// <summary>
271
284
/// Allows to filter out documents based on a minimum score:
272
285
/// </summary>
273
286
public SearchDescriptor < T > MinScore ( double minScore ) => Assign ( a => a . MinScore = minScore ) ;
274
287
275
288
/// <summary>
276
- /// The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
277
- /// If set, the response will have a boolean field terminated_early to indicate whether the query execution has actually terminated_early.
289
+ /// The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
290
+ /// If set, the response will have a boolean field terminated_early to indicate whether the query execution has actually terminated_early.
278
291
/// </summary>
279
292
public SearchDescriptor < T > TerminateAfter ( long terminateAfter ) => Assign ( a => a . TerminateAfter = terminateAfter ) ;
280
293
281
294
/// <summary>
282
295
/// <para>
283
- /// Controls a preference of which shard replicas to execute the search request on.
296
+ /// Controls a preference of which shard replicas to execute the search request on.
284
297
/// By default, the operation is randomized between the each shard replicas.
285
298
/// </para>
286
299
/// <para>
@@ -291,19 +304,19 @@ public SearchDescriptor<T> Source(Func<SourceFilterDescriptor<T>, ISourceFilter>
291
304
292
305
/// <summary>
293
306
/// <para>
294
- /// Controls a preference of which shard replicas to execute the search request on.
307
+ /// Controls a preference of which shard replicas to execute the search request on.
295
308
/// By default, the operation is randomized between the each shard replicas.
296
309
/// </para>
297
310
/// <para>
298
- /// The operation will go and be executed on the primary shard, and if not available (failover),
311
+ /// The operation will go and be executed on the primary shard, and if not available (failover),
299
312
/// will execute on other shards.
300
313
/// </para>
301
314
/// </summary>
302
315
public SearchDescriptor < T > ExecuteOnPrimaryFirst ( ) => this . Preference ( "_primary_first" ) ;
303
316
304
317
/// <summary>
305
318
/// <para>
306
- /// Controls a preference of which shard replicas to execute the search request on.
319
+ /// Controls a preference of which shard replicas to execute the search request on.
307
320
/// By default, the operation is randomized between the each shard replicas.
308
321
/// </para>
309
322
/// <para>
@@ -314,7 +327,7 @@ public SearchDescriptor<T> Source(Func<SourceFilterDescriptor<T>, ISourceFilter>
314
327
315
328
/// <summary>
316
329
/// <para>
317
- /// Controls a preference of which shard replicas to execute the search request on.
330
+ /// Controls a preference of which shard replicas to execute the search request on.
318
331
/// By default, the operation is randomized between the each shard replicas.
319
332
/// </para>
320
333
/// <para>
@@ -325,7 +338,7 @@ public SearchDescriptor<T> Source(Func<SourceFilterDescriptor<T>, ISourceFilter>
325
338
326
339
/// <summary>
327
340
/// <para>
328
- /// Controls a preference of which shard replicas to execute the search request on.
341
+ /// Controls a preference of which shard replicas to execute the search request on.
329
342
/// By default, the operation is randomized between the each shard replicas.
330
343
/// </para>
331
344
/// <para>
@@ -335,15 +348,15 @@ public SearchDescriptor<T> Source(Func<SourceFilterDescriptor<T>, ISourceFilter>
335
348
public SearchDescriptor < T > ExecuteOnPreferredNode ( string node ) => this . Preference ( node . IsNullOrEmpty ( ) ? null : $ "_prefer_node:{ node } ") ;
336
349
337
350
/// <summary>
338
- /// Allows to configure different boost level per index when searching across
351
+ /// Allows to configure different boost level per index when searching across
339
352
/// more than one indices. This is very handy when hits coming from one index
340
353
/// matter more than hits coming from another index (think social graph where each user has an index).
341
354
/// </summary>
342
355
public SearchDescriptor < T > IndicesBoost ( Func < FluentDictionary < IndexName , double > , FluentDictionary < IndexName , double > > boost ) =>
343
356
Assign ( a => a . IndicesBoost = boost ? . Invoke ( new FluentDictionary < IndexName , double > ( ) ) ) ;
344
357
345
358
/// <summary>
346
- /// Allows to selectively load specific fields for each document
359
+ /// Allows to selectively load specific fields for each document
347
360
/// represented by a search hit. Defaults to load the internal _source field.
348
361
/// </summary>
349
362
public SearchDescriptor < T > Fields ( Func < FieldsDescriptor < T > , IPromise < Fields > > fields ) =>
@@ -363,7 +376,7 @@ public SearchDescriptor<T> ScriptFields(Func<ScriptFieldsDescriptor, IPromise<IS
363
376
///</summary>
364
377
public SearchDescriptor < T > Sort ( Func < SortDescriptor < T > , IPromise < IList < ISort > > > selector ) => Assign ( a => a . Sort = selector ? . Invoke ( new SortDescriptor < T > ( ) ) ? . Value ) ;
365
378
366
- public SearchDescriptor < T > InnerHits ( Func < NamedInnerHitsDescriptor < T > , IPromise < INamedInnerHits > > selector ) =>
379
+ public SearchDescriptor < T > InnerHits ( Func < NamedInnerHitsDescriptor < T > , IPromise < INamedInnerHits > > selector ) =>
367
380
Assign ( a => a . InnerHits = selector ? . Invoke ( new NamedInnerHitsDescriptor < T > ( ) ) ? . Value ) ;
368
381
369
382
///<summary>
@@ -390,7 +403,7 @@ public SearchDescriptor<T> PostFilter(Func<QueryContainerDescriptor<T>, QueryCon
390
403
Assign ( a => a . PostFilter = filter . InvokeQuery ( new QueryContainerDescriptor < T > ( ) ) ) ;
391
404
392
405
/// <summary>
393
- /// Allow to highlight search results on one or more fields. The implementation uses the either lucene fast-vector-highlighter or highlighter.
406
+ /// Allow to highlight search results on one or more fields. The implementation uses the either lucene fast-vector-highlighter or highlighter.
394
407
/// </summary>
395
408
public SearchDescriptor < T > Highlight ( Func < HighlightDescriptor < T > , IHighlight > highlightSelector ) =>
396
409
Assign ( a => a . Highlight = highlightSelector ? . Invoke ( new HighlightDescriptor < T > ( ) ) ) ;
@@ -405,4 +418,4 @@ public SearchDescriptor<T> ConcreteTypeSelector(Func<dynamic, Hit<dynamic>, Type
405
418
Assign ( a => a . TypeSelector = typeSelector ) ;
406
419
407
420
}
408
- }
421
+ }
0 commit comments