Get Spotify catalog information about artists that match a keyword string.

@param q The search query's keywords (and optional field filters and operators).
@return A {@link SearchArtistsRequest.Builder}.
335469
public SearchArtistsRequest.Builder searchArtists(String q) {
    return new SearchArtistsRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port)
            .q(q);
  }
840750
public List<CmsSearchResult> getSearchResult() {

        if ((m_cms != null)
            && (m_result == null)
            && (m_parameters.getIndex() != null)
            && (m_parameters.isIgnoreQuery()
                || CmsStringUtil.isNotEmpty(m_parameters.getQuery())
                || CmsStringUtil.isNotEmpty(m_parameters.getParsedQuery())
                || (m_parameters.getFieldQueries() != null))) {

            if (!m_parameters.isIgnoreQuery()
                && CmsStringUtil.isEmpty(m_parameters.getParsedQuery())
                && (getQueryLength() > 0)) {

                if (m_parameters.getFieldQueries() != null) {
                    // check all field queries if the length of the query is ok
                    for (CmsSearchParameters.CmsSearchFieldQuery fq : m_parameters.getFieldQueries()) {
                        for (String keyword : fq.getSearchTerms()) {
                            if (CmsStringUtil.isEmpty(keyword) || (keyword.trim().length() < getQueryLength())) {

                                m_lastException = new CmsSearchException(
                                    Messages.get().container(
                                        Messages.ERR_QUERY_TOO_SHORT_1,
                                        new Integer(getQueryLength())));

                                return null;
                            }
                        }
                    }

                } else if (m_parameters.getQuery().trim().length() < getQueryLength()) {

                    m_lastException = new CmsSearchException(
                        Messages.get().container(Messages.ERR_QUERY_TOO_SHORT_1, new Integer(getQueryLength())));

                    return null;
                }
            }

            try {

                CmsSearchResultList result = m_parameters.getSearchIndex().search(m_cms, getParameters());

                if (result.size() > 0) {

                    m_result = result;
                    m_searchResultCount = result.getHitCount();
                    m_categoriesFound = result.getCategories();

                    // re-caluclate the number of pages for this search result
                    m_pageCount = m_searchResultCount / m_parameters.getMatchesPerPage();
                    if ((m_searchResultCount % m_parameters.getMatchesPerPage()) != 0) {
                        m_pageCount++;
                    }

                    // re-calculate the URLs to browse forward and backward in the search result
                    String url = m_cms.getRequestContext().getUri() + m_parameters.toQueryString() + "&searchPage=";
                    if (m_parameters.getSearchPage() > 1) {
                        m_prevUrl = url + (m_parameters.getSearchPage() - 1);
                    }
                    if (m_parameters.getSearchPage() < m_pageCount) {
                        m_nextUrl = url + (m_parameters.getSearchPage() + 1);
                    }
                } else {
                    m_result = Collections.emptyList();
                    m_searchResultCount = 0;
                    m_categoriesFound = null;
                    m_pageCount = 0;
                    m_prevUrl = null;
                    m_nextUrl = null;
                }
            } catch (Exception exc) {

                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_SEARCHING_FAILED_0), exc);
                }

                m_result = null;
                m_searchResultCount = 0;
                m_pageCount = 0;

                m_lastException = exc;
            }
        }

        return m_result;
    }
1108441
public GetArtistsAlbumsRequest.Builder getArtistsAlbums(String id) {
    return new GetArtistsAlbumsRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port)
            .id(id);
  }
1008060
def getSearchUrl(self, album, artist):
    
    url = "%s/search" % (__class__.BASE_URL)
    params = collections.OrderedDict()
    params["search-alias"] = "digital-music"
    params["field-keywords"] = " ".join((artist, album))
    params["sort"] = "relevancerank"
    return __class__.assembleUrl(url, params)
650482
@GET
  @Produces(APPLICATION_JSON)
  @Timed
  @ExceptionMetered
  public Map<JobId, Job> list(
      @QueryParam("q") @DefaultValue("") final String query,
      @QueryParam("hostPattern") @DefaultValue("") final String hostPattern) {

    final Map<JobId, Job> allJobs;
    if (!hostPattern.isEmpty()) {
      // for each host that matches this pattern...
      allJobs = model.listHosts(hostPattern).stream()
          // get the host status
          .map(model::getHostStatus)
          // then flat map over the jobs deployed to this host
          .flatMap(hostStatus -> hostStatus.getJobs().keySet().stream())
          .distinct()
          .collect(Collectors.toMap(Function.identity(), model::getJob));
    } else {
      allJobs = model.getJobs();
    }

    // Return all jobs if the query string is empty
    if (query.isEmpty()) {
      metrics.jobsInJobList(allJobs.size());
      return allJobs;
    }

    // Filter jobs by jobname query
    final Map<JobId, Job> filteredJobs = Maps.newHashMap();
    for (final Map.Entry<JobId, Job> entry : allJobs.entrySet()) {
      if (entry.getKey().toString().contains(query)) {
        filteredJobs.put(entry.getKey(), entry.getValue());
      }
    }

    metrics.jobsInJobList(filteredJobs.size());
    return filteredJobs;
  }
331196
def get_by_string(cls, fields, query):
	''''''
	try: pk = int(query)
	except ValueError: pass
	else: return cls.objects.get(pk=pk)
	obj = list(cls.objects.filter(reduce( op.or_,
		list(Q(**{'{}__icontains'.format(f): query}) for f in fields) )))
	if len(obj) > 1:
		raise cls.MultipleObjectsReturned((
			u'Unable to uniquely identify {}'
				' by provided criteria: {!r} (candidates: {})' )\
			.format(cls.__name__, query, ', '.join(it.imap(unicode, obj))) )
	elif not len(obj):
		raise cls.DoesNotExist(
			u'Unable to find site by provided criteria: {!r}'.format(query) )
	return obj[0]
1190623
public <T> List<T> search(QueryBuilder<T> builder) {
    return (List<T>) search(builder.build());
  }
889362
public SearchRequestBuilder getSearchRequestBuilder(String[] indices,
            String[] types, QueryBuilder queryBuilder,
            AggregationBuilder[] aggregationBuilders) {
        return getSearchRequestBuilder(false, indices, types,
                queryBuilder, aggregationBuilders);
    }
269002
public Query queryUsers(String ql) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("ql", ql);
        Query q = queryEntitiesRequest(HttpMethod.GET, params, null,organizationId,
                applicationId, "users");
        return q;
    }
408924
def get_search_results(self, request, queryset, search_term):
        
        # Apply keyword searches.
        def construct_search(field_name):
            if field_name.startswith('^'):
                return "%s__istartswith" % field_name[1:]
            elif field_name.startswith('='):
                return "%s__iexact" % field_name[1:]
            elif field_name.startswith('@'):
                return "%s__search" % field_name[1:]
            else:
                return "%s__icontains" % field_name

        use_distinct = False
        if self.search_fields and search_term:
            orm_lookups = [construct_search(str(search_field))
                           for search_field in self.search_fields]
            for bit in search_term.split():
                or_queries = [models.Q(**{orm_lookup: bit})
                              for orm_lookup in orm_lookups]
                queryset = queryset.filter(reduce(operator.or_, or_queries))
            if not use_distinct:
                for search_spec in orm_lookups:
                    if lookup_needs_distinct(self.opts, search_spec):
                        use_distinct = True
                        break

        return queryset, use_distinct
293960
def search(session, query):
    
    flat_query = "".join(query.split())

    artists = session.query(Artist).filter(
            or_(Artist.name.ilike(f"%%{query}%%"),
                Artist.name.ilike(f"%%{flat_query}%%"))
               ).all()
    albums = session.query(Album).filter(
            Album.title.ilike(f"%%{query}%%")).all()
    tracks = session.query(Track).filter(
            Track.title.ilike(f"%%{query}%%")).all()

    return dict(artists=artists,
                albums=albums,
                tracks=tracks)
1284940
public JSONObject searchInFacetValues(String facetName, String facetQuery, Query params, RequestOptions requestOptions) throws AlgoliaException {
    params = params == null ? new Query() : params;
    String paramsString = params.setFacetQuery(facetQuery).getQueryString();
    JSONObject body = new JSONObject();
    String encodedFacetName;
    try {
      encodedFacetName = URLEncoder.encode(facetName, "UTF-8");
      body.put("params", paramsString);
    } catch (JSONException e) {
      throw new RuntimeException(e);
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
    return client.postRequest("/1/indexes/" + encodedIndexName + "/facets/" + encodedFacetName + "/query", body.toString(), false, true, requestOptions);
  }
974764
function(query) {
        var q = rql2es(_.rql(query)),
            mapFn = q.fields ?
                          function(x) { return x.fields; } 
                        : function(x) { return x._source; };
        return ajax('POST', this._url + '/_search', q)
            .then(function(result) {
                return result.hits.hits.map(mapFn);
            });
    }
692577
def search_song(self, title, artist="", get_full_info=True):
        

        # Search the Genius API for the specified song
        if self.verbose:
            if artist:
                print('Searching for "{s}" by {a}...'.format(s=title, a=artist))
            else:
                print('Searching for "{s}"...'.format(s=title))
        search_term = "{s} {a}".format(s=title, a=artist).strip()
        response = self.search_genius_web(search_term)

        # Otherwise, move forward with processing the search results
        result = self._get_item_from_search_response(response, type_="song")

        # Exit search if there were no results returned from API
        if not result:
            if self.verbose:
                print("No results found for: '{s}'".format(s=search_term))
            return None

        # Reject non-songs (Liner notes, track lists, etc.)
        valid = self._result_is_lyrics(result['title']) if self.skip_non_songs else True
        if not valid:
            if self.verbose:
                print('Specified song does not contain lyrics. Rejecting.')
            return None

        # Download full song info (an API call) unless told not to by user
        song_info = result.copy()
        if get_full_info:
            song_info.update(self.get_song(result['id'])['song'])
        lyrics = self._scrape_song_lyrics_from_url(song_info['url'])

        # Skip results when URL is a 404 or lyrics are missing
        if not lyrics:
            if self.verbose:
                print('Specified song does not have a valid URL with lyrics. Rejecting.')
            return None

        # Return a Song object with lyrics if we've made it this far
        song = Song(song_info, lyrics)
        if self.verbose:
            print('Done.')
        return song
798603
public static appqoeaction[] get(nitro_service service) throws Exception{
		appqoeaction obj = new appqoeaction();
		appqoeaction[] response = (appqoeaction[])obj.get_resources(service);
		return response;
	}
1051664
private SearchResponse getSearchResponse(KunderaQuery kunderaQuery, FilteredQueryBuilder queryBuilder,
            QueryBuilder filter, ESQuery query, EntityMetadata m, int firstResult, int maxResults,
            KunderaMetadata kunderaMetadata)
    {
        SearchRequestBuilder builder = client.prepareSearch(m.getSchema().toLowerCase())
                .setTypes(m.getEntityClazz().getSimpleName());
        AggregationBuilder aggregation = query.buildAggregation(kunderaQuery, m, filter);

        if (aggregation == null)
        {
            builder.setQuery(queryBuilder);
            builder.setFrom(firstResult);
            builder.setSize(maxResults);
            addSortOrder(builder, kunderaQuery, m, kunderaMetadata);
        }
        else
        {
            log.debug("Aggregated query identified");
            builder.addAggregation(aggregation);

            if (kunderaQuery.getResult().length == 1 || (kunderaQuery.isSelectStatement()
                    && KunderaQueryUtils.hasGroupBy(kunderaQuery.getJpqlExpression())))
            {
                builder.setSize(0);
            }
        }

        SearchResponse response = null;
        log.debug("Query generated: " + builder);

        try
        {
            response = builder.execute().actionGet();
            log.debug("Query execution response: " + response);
        }
        catch (ElasticsearchException e)
        {
            log.error("Exception occured while executing query on Elasticsearch.", e);
            throw new KunderaException("Exception occured while executing query on Elasticsearch.", e);
        }

        return response;
    }
1067941
public Map<String, List<String>> getQueryString() {
    if (querystring == null) {
      try {
        querystring = new QueryStringDecoder(request.getUri()).getParameters();
      } catch (IllegalArgumentException e) {
        throw new BadRequestException("Bad query string: " + e.getMessage());
      }
    }
    return querystring;
  }