// Boost sets the boost for this query.
195615
func (q *MultiMatchQuery) Boost(boost float64) *MultiMatchQuery {
	q.boost = &boost
	return q
}
428971
func (s *SearchSource) Query(query Query) *SearchSource {
	s.query = query
	return s
}
1157421
func (q *HasChildQuery) Boost(boost float64) *HasChildQuery {
	q.boost = &boost
	return q
}
47780
func (q *HasParentQuery) Boost(boost float64) *HasParentQuery {
	q.boost = &boost
	return q
}
117456
func (r *SearchRequest) Query(query Query) *SearchRequest {
	r.searchSource = r.searchSource.Query(query)
	return r
}
174411
func (q *TermQuery) Boost(boost float32) *TermQuery {
	q.options["boost"] = boost
	return q
}
376551
func (q *ConstantScoreQuery) Boost(boost float64) *ConstantScoreQuery {
	q.boost = &boost
	return q
}
86154
func (q MatchAllQuery) Source() interface{} {
	// {
	//   "match_all" : { ... }
	// }
	source := make(map[string]interface{})
	params := make(map[string]interface{})
	source["match_all"] = params
	if q.boost != nil {
		params["boost"] = q.boost
	}
	if q.normsField != "" {
		params["norms_field"] = q.normsField
	}
	return source
}
638767
func (q *FuzzyQuery) Boost(boost float64) *FuzzyQuery {
	q.boost = &boost
	return q
}
799342
func (q *GeoDistanceQuery) Boost(boost float32) *GeoDistanceQuery {
	q.options["boost"] = boost
	return q
}
277293
func (q *ParentIdQuery) Boost(boost float64) *ParentIdQuery {
	q.boost = &boost
	return q
}
800585
func (r *SearchRequest) Highlight(highlight *Highlight) *SearchRequest {
	r.searchSource = r.searchSource.Highlight(highlight)
	return r
}
340661
func (q *BoostingQuery) Source() (interface{}, error) {
	// {
	//     "boosting" : {
	//         "positive" : {
	//             "term" : {
	//                 "field1" : "value1"
	//             }
	//         },
	//         "negative" : {
	//             "term" : {
	//                 "field2" : "value2"
	//             }
	//         },
	//         "negative_boost" : 0.2
	//     }
	// }

	query := make(map[string]interface{})

	boostingClause := make(map[string]interface{})
	query["boosting"] = boostingClause

	// Negative and positive clause as well as negative boost
	// are mandatory in the Java client.

	// positive
	if q.positiveClause != nil {
		src, err := q.positiveClause.Source()
		if err != nil {
			return nil, err
		}
		boostingClause["positive"] = src
	}

	// negative
	if q.negativeClause != nil {
		src, err := q.negativeClause.Source()
		if err != nil {
			return nil, err
		}
		boostingClause["negative"] = src
	}

	if q.negativeBoost != nil {
		boostingClause["negative_boost"] = *q.negativeBoost
	}

	if q.boost != nil {
		boostingClause["boost"] = *q.boost
	}

	return query, nil
}
100823
func (s *CountService) Query(query Query) *CountService {
	s.query = query
	return s
}
335481
func (d *DnsCache) Query(addr string) (string, bool) {
	ipPort, ok := d.ipPortLib.Load(addr)
	if !ok {
		return "", false
	}
	return ipPort.(string), true
}
145649
func (q *BooleanQuery) Boost(boost float32) *BooleanQuery {
	q.data.Boost = boost
	return q
}
1342057
func (fn FactorFunction) BoostFactor(boost float32) FactorFunction {
	fn.boostFactor = &boost
	return fn
}