Skip to content

Commit

Permalink
Handle _parent and _routing attributes in response
Browse files Browse the repository at this point in the history
  • Loading branch information
lebauce committed Oct 25, 2016
1 parent 34c4c4d commit bc3c29e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/baseresponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ type BaseResponse struct {
Index string `json:"_index,omitempty"`
Type string `json:"_type,omitempty"`
Id string `json:"_id,omitempty"`
Parent string `json:"_parent,omitempty"` // for parent/child requests
Routing string `json:"_routing,omitempty"`
Source *json.RawMessage `json:"_source,omitempty"` // depends on the schema you've defined
Version int `json:"_version,omitempty"`
Found bool `json:"found,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions lib/coresearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ type Hit struct {
Index string `json:"_index"`
Type string `json:"_type,omitempty"`
Id string `json:"_id"`
Parent string `json:"_parent,omitempty"` // for parent/child requests
Routing string `json:"_routing,omitempty"`
Score Float32Nullable `json:"_score,omitempty"` // Filters (no query) dont have score, so is null
Source *json.RawMessage `json:"_source"` // marshalling left to consumer
Fields *json.RawMessage `json:"fields"` // when a field arg is passed to ES, instead of _source it returns fields
Expand Down

0 comments on commit bc3c29e

Please sign in to comment.