Skip to content

Commit a1559f3

Browse files
[Backport 7.10] Obsolete options on SamplerAggregation (#5066)
As highlighted by #5032 Co-authored-by: Martijn Laarman <Mpdreamz@gmail.com>
1 parent 318db97 commit a1559f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Nest/Aggregations/Bucket/Sampler/SamplerAggregation.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ namespace Nest
1212
[ReadAs(typeof(SamplerAggregation))]
1313
public interface ISamplerAggregation : IBucketAggregation
1414
{
15+
[Obsolete("This option is not valid for the sampler aggregation and only applies to IDiversifiedSamplerAggregation")]
1516
[DataMember(Name ="execution_hint")]
1617
SamplerAggregationExecutionHint? ExecutionHint { get; set; }
1718

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)