// SearchQuery performs a n1ql query and returns a list of rows or an error.
485197
func (c *Cluster) SearchQuery(q SearchQuery, opts *SearchQueryOptions) (*SearchResults, error) {
	if opts == nil {
		opts = &SearchQueryOptions{}
	}
	ctx := opts.Context
	if ctx == nil {
		ctx = context.Background()
	}

	var span opentracing.Span
	if opts.ParentSpanContext == nil {
		span = opentracing.GlobalTracer().StartSpan("ExecuteSearchQuery",
			opentracing.Tag{Key: "couchbase.service", Value: "fts"})
	} else {
		span = opentracing.GlobalTracer().StartSpan("ExecuteSearchQuery",
			opentracing.Tag{Key: "couchbase.service", Value: "fts"}, opentracing.ChildOf(opts.ParentSpanContext))
	}
	defer span.Finish()

	provider, err := c.getHTTPProvider()
	if err != nil {
		return nil, err
	}

	return c.searchQuery(ctx, span.Context(), q, opts, provider)
}
1310565
func (db *DB) Search(query, sortBy string, offset, count int) ([]*Doc, error) {
	var docs []*Doc
	err := db.store.Select(db.meta, &docs, `where "ID" in (select "ID" from "rsc.io/rsc/scancab/database.text" where "rsc.io/rsc/scancab/database.text" match ?) order by `+sortBy+` limit ? offset ?`, query, count, offset)
	if err != nil {
		return nil, err
	}
	return docs, nil
}
582876
func (s *IssueService) Search(jql string, options *SearchOptions) ([]Issue, *Response, error) {
	var u string
	if options == nil {
		u = fmt.Sprintf("rest/api/2/search?jql=%s", url.QueryEscape(jql))
	} else {
		u = fmt.Sprintf("rest/api/2/search?jql=%s&startAt=%d&maxResults=%d&expand=%s&fields=%s&validateQuery=%s", url.QueryEscape(jql),
			options.StartAt, options.MaxResults, options.Expand, strings.Join(options.Fields, ","), options.ValidateQuery)
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return []Issue{}, nil, err
	}

	v := new(searchResult)
	resp, err := s.client.Do(req, v)
	if err != nil {
		err = NewJiraError(resp, err)
	}
	return v.Issues, resp, err
}
117456
func (r *SearchRequest) Query(query Query) *SearchRequest {
	r.searchSource = r.searchSource.Query(query)
	return r
}
603824
func (s *ScanService) Query(query Query) *ScanService {
	s.searchSource = s.searchSource.Query(query)
	return s
}
1172161
func (s *QueryService) Query(ctx context.Context, req *query.Request) (flux.ResultIterator, error) {
	return s.QueryF(ctx, req)
}
722888
func (q SearchQuery) Do(client *Client) (res SearchResult, err error) {
	fullUrl := fmt.Sprintf("search/%s", q)
	err = client.magicRequestDecoder("GET", fullUrl, nil, &res)
	return
}
716403
func GetQuery(req *http.Request, key string) []string {
	if ok, value := extractQueries(req); ok {
		return value[key]
	}
	return nil
}
598142
func (d *Datastore) Query(q dsq.Query) (dsq.Results, error) {
	err := d.Flush()
	if err != nil {
		return nil, err
	}

	return d.child.Query(q)
}
446556
func (tx *Tx) QueryRowEx(ctx context.Context, sql string, options *QueryExOptions, args ...interface{}) *Row {
	rows, _ := tx.QueryEx(ctx, sql, options, args...)
	return (*Row)(rows)
}
1164675
func (si *SolrInterface) Search(q *Query) *Search {
	return NewSearch(si.conn, q)
}
515731
func (tx *Tx) Query(sql string, args ...interface{}) (*Rows, error) {
	return tx.QueryEx(context.Background(), sql, nil, args...)
}
1282522
func (p *ConnPool) Query(sql string, args ...interface{}) (*Rows, error) {
	c, err := p.Acquire()
	if err != nil {
		// Because checking for errors can be deferred to the *Rows, build one with the error
		return &Rows{closed: true, err: err}, err
	}

	rows, err := c.Query(sql, args...)
	if err != nil {
		p.Release(c)
		return rows, err
	}

	rows.connPool = p

	return rows, nil
}
100823
func (s *CountService) Query(query Query) *CountService {
	s.query = query
	return s
}
13393
func (q *FunctionScoreQuery) Query(query Query) *FunctionScoreQuery {
	q.query = query
	return q
}
1272060
func (c *Conn) QueryRow(sql string, args ...interface{}) *Row {
	rows, _ := c.Query(sql, args...)
	return (*Row)(rows)
}
1339945
func NamedQuery(e Ext, query string, arg interface{}) (*Rows, error) {
	q, args, err := bindNamedMapper(BindType(e.DriverName()), query, arg, mapperFor(e))
	if err != nil {
		return nil, err
	}
	return e.Queryx(q, args...)
}