From 65071d8e342349f54e8039b748fb236198080a70 Mon Sep 17 00:00:00 2001 From: Steven Ferrer Date: Mon, 22 Jun 2020 19:47:20 +0800 Subject: [PATCH] added some notes on query response --- query/response.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/query/response.go b/query/response.go index 9096c03..5fe229c 100644 --- a/query/response.go +++ b/query/response.go @@ -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