Skip to content

Commit

Permalink
Change FieldAggregate.Size type to *int to accept size 0
Browse files Browse the repository at this point in the history
  • Loading branch information
nullbus committed Apr 1, 2015
1 parent 8ead27f commit de6fa57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/searchaggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type AggregateDsl struct {

type FieldAggregate struct {
Field string `json:"field"`
Size int `json:"size,omitempty"`
Size *int `json:"size,omitempty"`
}

/**
Expand Down Expand Up @@ -152,7 +152,7 @@ func (d *AggregateDsl) Terms(field string) *AggregateDsl {
}

func (d *AggregateDsl) TermsWithSize(field string, size int) *AggregateDsl {
d.Type = FieldAggregate{Field: field, Size: size}
d.Type = FieldAggregate{Field: field, Size: &size}
d.TypeName = "terms"
return d
}
Expand Down

0 comments on commit de6fa57

Please sign in to comment.