Skip to content

Commit

Permalink
[Backport 7.6] Add flattened usage field count (#4413)
Browse files Browse the repository at this point in the history
Relates: #4341, elastic/elasticsearch#48972

Co-authored-by: Russ Cam <russ.cam@elastic.co>
  • Loading branch information
github-actions[bot] and russcam committed Feb 21, 2020
1 parent 51b1569 commit b3fd1b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Nest/XPack/Info/XPackUsage/XPackUsageResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class XPackUsageResponse : ResponseBase
public XPackUsage DataFrame { get; internal set; }

[DataMember(Name = "flattened")]
public XPackUsage Flattened { get; internal set; }
public FlattenedUsage Flattened { get; internal set; }

[DataMember(Name = "data_science")]
public XPackUsage DataScience { get; internal set; }
Expand Down Expand Up @@ -148,6 +148,15 @@ public class XPackUsage
public bool Enabled { get; internal set; }
}

public class FlattenedUsage : XPackUsage
{
/// <summary>
/// Available in Elasticsearch 7.6.0+
/// </summary>
[DataMember(Name = "field_count")]
public int? FieldCount { get; internal set; }
}

public class VectorUsage : XPackUsage
{
[DataMember(Name = "dense_vector_fields_count")]
Expand Down
3 changes: 3 additions & 0 deletions tests/Tests/XPack/Info/XPackInfoApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ [I] public async Task XPackUsageResponse() => await Assert<XPackUsageResponse>(X
#pragma warning disable 618
r.DataFrame.Should().NotBeNull();
#pragma warning restore 618
if (TestConfiguration.Instance.InRange(">=7.6.0"))
r.Flattened.FieldCount.Should().HaveValue();
}
if (TestConfiguration.Instance.InRange(">=7.5.0"))
Expand Down

0 comments on commit b3fd1b0

Please sign in to comment.