added convenience method to add field to highlight request
This commit is contained in:
parent
9d2187706e
commit
afdb5f057f
|
@ -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
|
// A SearchRequest describes all the parameters
|
||||||
// needed to search the index.
|
// needed to search the index.
|
||||||
// Query is required.
|
// Query is required.
|
||||||
|
|
Loading…
Reference in New Issue