// Query in the Lucene query string syntax.
16685
func (s *ExplainService) Q(q string) *ExplainService {
	s.q = q
	return s
}
766940
func (s *ExplainService) Query(query Query) *ExplainService {
	src, err := query.Source()
	if err != nil {
		// Do nothing in case of an error
		return s
	}
	body := make(map[string]interface{})
	body["query"] = src
	s.bodyJson = body
	return s
}
234335
func (d *database) Query(ctx context.Context, query string, bindVars map[string]interface{}) (Cursor, error) {
	req, err := d.conn.NewRequest("POST", path.Join(d.relPath(), "_api/cursor"))
	if err != nil {
		return nil, WithStack(err)
	}
	input := queryRequest{
		Query:    query,
		BindVars: bindVars,
	}
	input.applyContextSettings(ctx)
	if _, err := req.SetBody(input); err != nil {
		return nil, WithStack(err)
	}
	cs := applyContextSettings(ctx, req)
	resp, err := d.conn.Do(ctx, req)
	if err != nil {
		return nil, WithStack(err)
	}
	if err := resp.CheckStatus(201); err != nil {
		return nil, WithStack(err)
	}
	var data cursorData
	if err := resp.ParseBody("", &data); err != nil {
		return nil, WithStack(err)
	}
	col, err := newCursor(data, resp.Endpoint(), d, cs.AllowDirtyReads)
	if err != nil {
		return nil, WithStack(err)
	}
	return col, nil
}
845779
func (s *Store) Query(qr *QueryRequest) (*QueryResponse, error) {
	return s.query(nil, qr)
}
1258245
func (s *CrateStmt) Query(args []driver.Value) (driver.Rows, error) {
	return s.driver.Query(s.stmt, args)
}
878263
func (IS *InvertedSuffix) Query(Word string, ResultsLimit int) ([]string, []interface{}) {
	Query := IS.Converter(Word)
	if ResultsLimit == 0 {
		return []string{}, []interface{}{}
	}
	if ResultsLimit < 0 {
		ResultsLimit = 0
	}
	Results := make([]string, 0, ResultsLimit)
	Values := make([]interface{}, 0, ResultsLimit)
	low, high := IS.Search(Query)
	a := 0
	used := make(map[int]bool, 0)
	for k := low; k < high; k++ {
		x := IS.WordIndex[k]
		if _, ok := used[x]; ok {
			continue
		}
		used[x] = true
		Results = append(Results, IS.Results[x])
		Values = append(Values, IS.Values[x])
		a++
		if a == ResultsLimit {
			return Results, Values
		}
	}
	return Results, Values
}
1340657
func (e *ElasticsearchExecutor) Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error) {
	if len(tsdbQuery.Queries) == 0 {
		return nil, fmt.Errorf("query contains no queries")
	}

	client, err := es.NewClient(ctx, dsInfo, tsdbQuery.TimeRange)
	if err != nil {
		return nil, err
	}

	query := newTimeSeriesQuery(client, tsdbQuery, intervalCalculator)
	return query.execute()
}
1152625
func (s *ProxyQueryService) Query(ctx context.Context, w io.Writer, req *query.ProxyRequest) (int64, error) {
	if req != nil {
		s.Logger.Info("query", zap.Any("request", req))
	}
	n, err := w.Write([]byte{})
	return int64(n), err
}
13393
func (q *FunctionScoreQuery) Query(query Query) *FunctionScoreQuery {
	q.query = query
	return q
}
1345646
func Query(q string) func(r *Rego) {
	return func(r *Rego) {
		r.query = q
	}
}
1373177
func (q *QueryDsl) Search(searchFor string) *QueryDsl {
	//I don't think this is right, it is not a filter.query, it should be q query?
	qs := NewQueryString("", "")
	q.QueryEmbed.Qs = &qs
	q.QueryEmbed.Qs.Query = searchFor
	return q
}
1146764
func (b *SearchRequestBuilder) Query() *QueryBuilder {
	if b.queryBuilder == nil {
		b.queryBuilder = NewQueryBuilder()
	}
	return b.queryBuilder
}
184894
func (engine *Engine) Query(sqlorArgs ...interface{}) (resultsSlice []map[string][]byte, err error) {
	session := engine.NewSession()
	defer session.Close()
	return session.Query(sqlorArgs...)
}
693791
func (c *Connection) Query(qr *QueryRequest) (*QueryResponse, error) {
	c.dbMu.RLock()
	defer c.dbMu.RUnlock()
	if c.db == nil {
		return nil, ErrConnectionDoesNotExist
	}
	return c.store.query(c, qr)
}
1293153
func Query(query string) (*Message, error) {
	ddgUrl := EncodeUrl(query)

	body, err := Do(ddgUrl)
	if err != nil {
		return nil, err
	}

	message := &Message{}
	if err = message.Decode(body); err != nil {
		return nil, err
	}

	return message, nil
}
1164029
func (fsc *FetchSourceContext) Query() url.Values {
	params := url.Values{}
	if fsc.fetchSource {
		if len(fsc.includes) > 0 {
			params.Add("_source_includes", strings.Join(fsc.includes, ","))
		}
		if len(fsc.excludes) > 0 {
			params.Add("_source_excludes", strings.Join(fsc.excludes, ","))
		}
	} else {
		params.Add("_source", "false")
	}
	return params
}
187574
func (f *MinhashLSH) Query(sig []uint64) []interface{} {
	set := f.query(sig, f.k)
	results := make([]interface{}, 0, len(set))
	for key := range set {
		results = append(results, key)
	}
	return results
}