0
0
Fork 0

added convenience method to add field to highlight request

This commit is contained in:
Marty Schoch 2014-09-04 10:13:13 -04:00
parent 9d2187706e
commit afdb5f057f
1 changed files with 7 additions and 0 deletions

View File

@ -137,6 +137,13 @@ func NewHighlightWithStyle(style string) *HighlightRequest {
}
}
func (h *HighlightRequest) AddField(field string) {
if h.Fields == nil {
h.Fields = make([]string, 0, 1)
}
h.Fields = append(h.Fields, field)
}
// A SearchRequest describes all the parameters
// needed to search the index.
// Query is required.