Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Nest/Aggregations/Bucket/Sampler/SamplerAggregation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ namespace Nest
[ReadAs(typeof(SamplerAggregation))]
public interface ISamplerAggregation : IBucketAggregation
{
[Obsolete("This option is not valid for the sampler aggregation and only applies to IDiversifiedSamplerAggregation")]
[DataMember(Name ="execution_hint")]
SamplerAggregationExecutionHint? ExecutionHint { get; set; }

[Obsolete("This option is not valid for the sampler aggregation and only applies to IDiversifiedSamplerAggregation")]
[DataMember(Name ="max_docs_per_value")]
int? MaxDocsPerValue { get; set; }

[Obsolete("This option is not valid for the sampler aggregation and only applies to IDiversifiedSamplerAggregation")]
[DataMember(Name ="script")]
IScript Script { get; set; }

Expand Down Expand Up @@ -48,6 +51,7 @@ public class SamplerAggregationDescriptor<T>
IScript ISamplerAggregation.Script { get; set; }
int? ISamplerAggregation.ShardSize { get; set; }

#pragma warning disable 618
public SamplerAggregationDescriptor<T> ExecutionHint(SamplerAggregationExecutionHint? executionHint) =>
Assign(executionHint, (a, v) => a.ExecutionHint = v);

Expand All @@ -57,6 +61,7 @@ public SamplerAggregationDescriptor<T> ExecutionHint(SamplerAggregationExecution

public SamplerAggregationDescriptor<T> Script(Func<ScriptDescriptor, IScript> scriptSelector) =>
Assign(scriptSelector, (a, v) => a.Script = v?.Invoke(new ScriptDescriptor()));
#pragma warning restore 618

public SamplerAggregationDescriptor<T> ShardSize(int? shardSize) => Assign(shardSize, (a, v) => a.ShardSize = v);
}
Expand Down