Skip to content

Commit

Permalink
Add support for nested queries to search hits
Browse files Browse the repository at this point in the history
See #768
  • Loading branch information
wuurrd authored and olivere committed May 10, 2018
1 parent d63fad0 commit fd0ded6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions search.go
Expand Up @@ -467,6 +467,12 @@ type SearchHits struct {
Hits []*SearchHit `json:"hits"` // the actual hits returned
}

// NestedHit is a nested innerhit
type NestedHit struct {
Field string `json:"field"`
Offset int `json:"offset"`
}

// SearchHit is a single hit.
type SearchHit struct {
Score *float64 `json:"_score"` // computed score
Expand All @@ -484,6 +490,7 @@ type SearchHit struct {
Explanation *SearchExplanation `json:"_explanation"` // explains how the score was computed
MatchedQueries []string `json:"matched_queries"` // matched queries
InnerHits map[string]*SearchHitInnerHits `json:"inner_hits"` // inner hits with ES >= 1.5.0
Nested *NestedHit `json:"_nested"`

// Shard
// HighlightFields
Expand Down

0 comments on commit fd0ded6

Please sign in to comment.