// IndexBoost sets the boost that a specific index will receive when the
// query is executed against it.
501852
func (s *SearchSource) IndexBoost(index string, boost float64) *SearchSource {
	s.indexBoosts[index] = boost
	return s
}
749469
func (q *DocIdQuery) Boost(boost float32) *DocIdQuery {
	q.options["boost"] = boost
	return q
}
1108810
func (q *NumericRangeQuery) Boost(boost float32) *NumericRangeQuery {
	q.options["boost"] = boost
	return q
}
932723
func (q *PrefixQuery) Boost(boost float64) *PrefixQuery {
	q.boost = &boost
	return q
}
1174838
func (s *session) IndexRangeByScore(index Index, min, max int64, opts ...RangeOption) (RangeResult, error) {
	action, result, err := s.indexRangeByScore(index, min, max, s.applyRangeOption(opts))
	if err != nil {
		return nil, s.catch("IndexRangeByScore: "+action, err)
	}
	return result, nil
}
681619
func (q *DisMaxQuery) Boost(boost float64) *DisMaxQuery {
	q.boost = &boost
	return q
}
170062
func IndexSort(data sort.Interface) []int {
	indexes := make([]int, data.Len())
	for i := range indexes {
		indexes[i] = i
	}
	sort.Sort(InterfaceStruct{
		LenF: data.Len,
		LessF: func(i, j int) bool {
			return data.Less(indexes[i], indexes[j])
		},
		SwapF: func(i, j int) {
			indexes[i], indexes[j] = indexes[j], indexes[i]
		},
	})
	return indexes
}
1361697
func (d *Context) ToBoolean(index int) bool {
	return int(C.duk_to_boolean(d.duk_context, C.duk_idx_t(index))) == 1
}
1336229
func (q *MatchPhrasePrefixQuery) Boost(boost float64) *MatchPhrasePrefixQuery {
	q.boost = &boost
	return q
}
143030
func (s *GlobalStore) keyIndex(key []byte) (index int, found bool) {
	l := len(s.keys)
	index = sort.Search(l, func(i int) bool {
		return bytes.Compare(s.keys[i], key) >= 0
	})
	found = index < l && bytes.Equal(s.keys[index], key)
	return index, found
}
1268872
func (q *ConjunctionQuery) Boost(boost float32) *ConjunctionQuery {
	q.options["boost"] = boost
	return q
}
1130469
func indexUpdate(typeName, indexName string, index Index, tx *bolt.Tx, key []byte, value interface{}, delete bool) error {
	indexKey, err := index(indexName, value)
	if indexKey == nil {
		return nil
	}

	indexValue := make(keyList, 0)

	if err != nil {
		return err
	}

	b, err := tx.CreateBucketIfNotExists(indexBucketName(typeName, indexName))
	if err != nil {
		return err
	}

	iVal := b.Get(indexKey)
	if iVal != nil {
		err = decode(iVal, &indexValue)
		if err != nil {
			return err
		}
	}

	if delete {
		indexValue.remove(key)
	} else {
		indexValue.add(key)
	}

	if len(indexValue) == 0 {
		return b.Delete(indexKey)
	}

	iVal, err = encode(indexValue)
	if err != nil {
		return err
	}

	return b.Put(indexKey, iVal)
}
699921
func (d *Context) IsBoolean(index int) bool {
	return int(C.duk_is_boolean(d.duk_context, C.duk_idx_t(index))) == 1
}
1274088
func IndexFloat(a, b string) bool {
	ia, _ := strconv.ParseFloat(a, 64)
	ib, _ := strconv.ParseFloat(b, 64)
	return ia < ib
}
1002617
func (q *TermsQuery) Boost(boost float64) *TermsQuery {
	q.boost = &boost
	return q
}
1111936
func (q *SimpleQueryStringQuery) Boost(boost float64) *SimpleQueryStringQuery {
	q.boost = &boost
	return q
}
153103
func (q *FunctionScoreQuery) Boost(boost float64) *FunctionScoreQuery {
	q.boost = &boost
	return q
}