Skip to content

Commit

Permalink
added some notes on query response
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenferrer committed Jun 22, 2020
1 parent b6d15ae commit 65071d8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions query/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ package query

// Response is a query response
type Response struct {
ResponseHeader ResponseHeader `json:"responseHeader"`
Response ResponseBody `json:"response,omitempty"`
Facets map[string]interface{} `json:"facets,omitempty"`
Error *Error `json:"error,omitempty"`
ResponseHeader ResponseHeader `json:"responseHeader"`
Response ResponseBody `json:"response,omitempty"`
// TODO: Extract/unmarshal facet data via tag e.g. solr:"count", solr:"val", etc.
Facets map[string]interface{} `json:"facets,omitempty"`
Error *Error `json:"error,omitempty"`
}

// ResponseBody is the response body
type ResponseBody struct {
NumFound int `json:"numFound,omitempty"`
Start int `json:"start,omitempty"`
MaxScore float64 `json:"maxScore,omitempty"`
Docs []map[string]interface{} `json:"docs,omitempty"`
NumFound int `json:"numFound,omitempty"`
Start int `json:"start,omitempty"`
MaxScore float64 `json:"maxScore,omitempty"`
// TODO: Extract/unmarshal facet data via tag e.g. solr:"title", solr:"desc", etc.
Docs []map[string]interface{} `json:"docs,omitempty"`
}

// ResponseHeader is a response header
Expand Down

0 comments on commit 65071d8

Please sign in to comment.