diff --git a/src/Nest/Aggregations/Bucket/Sampler/SamplerAggregation.cs b/src/Nest/Aggregations/Bucket/Sampler/SamplerAggregation.cs index 882bfbe6b08..f8fca14ddbc 100644 --- a/src/Nest/Aggregations/Bucket/Sampler/SamplerAggregation.cs +++ b/src/Nest/Aggregations/Bucket/Sampler/SamplerAggregation.cs @@ -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; } @@ -48,6 +51,7 @@ public class SamplerAggregationDescriptor IScript ISamplerAggregation.Script { get; set; } int? ISamplerAggregation.ShardSize { get; set; } +#pragma warning disable 618 public SamplerAggregationDescriptor ExecutionHint(SamplerAggregationExecutionHint? executionHint) => Assign(executionHint, (a, v) => a.ExecutionHint = v); @@ -57,6 +61,7 @@ public SamplerAggregationDescriptor ExecutionHint(SamplerAggregationExecution public SamplerAggregationDescriptor Script(Func scriptSelector) => Assign(scriptSelector, (a, v) => a.Script = v?.Invoke(new ScriptDescriptor())); +#pragma warning restore 618 public SamplerAggregationDescriptor ShardSize(int? shardSize) => Assign(shardSize, (a, v) => a.ShardSize = v); }