// Boost specifies the boost for this query.
196698
func (q *GeoBoundingBoxQuery) Boost(boost float32) *GeoBoundingBoxQuery {
	q.options["boost"] = boost
	return q
}
622619
func (q CustomScoreQuery) Source() interface{} {
	// "custom_score" : {
	//     "query" : {
	//         ....
	//     },
	//     "params" : {
	//         "param1" : 2,
	//         "param2" : 3.1
	//     },
	//     "script" : "_score * doc['my_numeric_field'].value / pow(param1, param2)"
	// }

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

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

	// query
	if q.query != nil {
		csq["query"] = q.query.Source()
	} else if q.filter != nil {
		csq["filter"] = q.filter.Source()
	}

	csq["script"] = q.script

	// lang
	if q.lang != "" {
		csq["lang"] = q.lang
	}

	// params
	if len(q.params) > 0 {
		csq["params"] = q.params
	}

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

	return query
}
1286001
func (q FuzzyQuery) Source() interface{} {
	// {
	//	"fuzzy" : {
	//		"user" : {
	//      "value" : "ki",
	//      "boost" : 1.0,
	//      "fuzziness" : 2,
	//      "prefix_length" : 0,
	//      "max_expansions" : 100
	//    }
	// }

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

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

	fq := make(map[string]interface{})
	query[q.name] = fq

	fq["value"] = q.value

	if q.boost != -1.0 {
		fq["boost"] = q.boost
	}
	if q.transpositions != nil {
		fq["transpositions"] = *q.transpositions
	}
	if q.fuzziness != nil {
		fq["fuzziness"] = q.fuzziness
	}
	if q.prefixLength != nil {
		fq["prefix_length"] = *q.prefixLength
	}
	if q.maxExpansions != nil {
		fq["max_expansions"] = *q.maxExpansions
	}
	if q.queryName != "" {
		fq["_name"] = q.queryName
	}

	return source
}
518519
func (c *xContext) Query(name string, defaults ...string) (value string) {
	value = c.request.URL().QueryValue(name)
	if len(value) == 0 && len(defaults) > 0 {
		return defaults[0]
	}
	return
}
1157421
func (q *HasChildQuery) Boost(boost float64) *HasChildQuery {
	q.boost = &boost
	return q
}
174411
func (q *TermQuery) Boost(boost float32) *TermQuery {
	q.options["boost"] = boost
	return q
}
1108810
func (q *NumericRangeQuery) Boost(boost float32) *NumericRangeQuery {
	q.options["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
}
283780
func (q *TermRangeQuery) Boost(boost float32) *TermRangeQuery {
	q.options["boost"] = boost
	return q
}
1137984
func (s *ScrollService) Query(query Query) *ScrollService {
	s.ss = s.ss.Query(query)
	return s
}
382253
func (q *PrefixQuery) Boost(boost float32) *PrefixQuery {
	q.options["boost"] = boost
	return q
}
591458
func (q *NestedQuery) Boost(boost float64) *NestedQuery {
	q.boost = &boost
	return q
}
798699
func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error) {
	list := make([]namedValue, len(args))
	for i, v := range args {
		list[i] = namedValue{
			Ordinal: i + 1,
			Value:   v,
		}
	}
	return c.query(context.Background(), query, list)
}
560547
func (q *MatchQuery) Boost(boost float32) *MatchQuery {
	q.options["boost"] = boost
	return q
}
47780
func (q *HasParentQuery) Boost(boost float64) *HasParentQuery {
	q.boost = &boost
	return q
}
1329997
func Q(c *Connection) *Query {
	return &Query{
		RawSQL:      &clause{},
		Connection:  c,
		eager:       c.eager,
		eagerFields: c.eagerFields,
	}
}
277293
func (q *ParentIdQuery) Boost(boost float64) *ParentIdQuery {
	q.boost = &boost
	return q
}