diff --git a/es.go b/es.go index bfcbb61..e218189 100644 --- a/es.go +++ b/es.go @@ -1582,7 +1582,7 @@ type ClusterAllocationExplainRequest struct { Primary bool `json:"primary,omitempty"` // Specifies the ID of the shard that you would like an explanation for. - Shard string `json:"shard,omitempty"` + Shard *int `json:"shard,omitempty"` } // ClusterAllocationExplain provides an explanation for a shard’s current allocation. diff --git a/es_test.go b/es_test.go index 5026c32..ac146fc 100644 --- a/es_test.go +++ b/es_test.go @@ -2103,6 +2103,7 @@ func TestGetNodesHotThreads(t *testing.T) { } func TestClusterAllocationExplain(t *testing.T) { + shardID := 0 tests := []struct { name string request *ClusterAllocationExplainRequest @@ -2138,9 +2139,9 @@ func TestClusterAllocationExplain(t *testing.T) { { name: "with shard set", request: &ClusterAllocationExplainRequest{ - Shard: "test-shard", + Shard: &shardID, }, - expectedBody: `{"shard":"test-shard"}`, + expectedBody: `{"shard":0}`, }, { name: "with pretty output",