Finding text messages by query

@param peer  peer for search
@param query query for search
@return found messages
518581
@ObjectiveCName("findTextMessagesWithPeer:withQuery:")
    public Command<List<MessageSearchEntity>> findTextMessages(Peer peer, String query) {
        return callback -> modules.getSearchModule().findTextMessages(peer, query)
                .then(v -> callback.onResult(v))
                .failure(e -> callback.onError(e));
    }
17359
public void search(String query) {
        final Query newQuery = searcher.getQuery().setQuery(query);
        searcher.setQuery(newQuery).search();
    }
75156
@ObjectiveCName("updateMessageWithPeer:withText:withRid:")
    public Promise<Void> updateMessage(@NotNull Peer peer, @NotNull String text, long rid) {
        return modules.getMessagesModule().updateMessage(peer, text, rid);
    }
555653
public BoxRequestsSearch.Search getSearchRequest(String query) {
        BoxRequestsSearch.Search request = new BoxRequestsSearch.Search(query, getSearchUrl(), mSession);
        return request;
    }
900023
public JSONObject searchRules(RuleQuery query) throws AlgoliaException, JSONException {
    return this.searchRules(query, RequestOptions.empty);
  }
598835
@SuppressWarnings("unchecked")
	static void findByQuery(final EntityManager em, final String query)
    {
        Query q = em.createNamedQuery(query);

        logger.info("[On Find All by Query]");
        List<User> users = q.getResultList();

        if (users == null || users.isEmpty())
        {
            logger.info("0 Users Returned");
            return;
        }

        System.out.println("#######################START##########################################");
        logger.info("\t\t Total number of users:" + users.size());
        logger.info("\t\t User's total tweets:" + users.get(0).getTweets().size());
        printTweets(users);
        logger.info("\n");
        // logger.info("First tweet:" users.get(0).getTweets().);
        System.out.println("#######################END############################################");
        logger.info("\n");
    }
401549
def messages(self, query, **kwargs):
        
        self.url = 'https://slack.com/api/search.messages'
        return super(Search, self).search_from_url(query, **kwargs)
688663
public static Intent findLocation(String query) {
        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_VIEW);
        String data = String.format("geo:0,0?q=%s", query);
        intent.setData(Uri.parse(data));
        return intent;
    }
777263
public Query getMails(String[] messageNumbers, String[] uids, boolean all) throws MessagingException, IOException {
	Query qry = new QueryImpl(all ? _fldnew : _flddo, 0, "query");
	Folder folder = _store.getFolder("INBOX");
	folder.open(Folder.READ_ONLY);
	try {
	    getMessages(qry, folder, uids, messageNumbers, startrow, maxrows, all);
	}
	finally {
	    folder.close(false);
	}
	return qry;
    }
63064
@Override
    public List<Person> findByQuery(String query) {
        //@formatter:off
        String queryStr = '%' + query.toLowerCase() + '%';
        String jpaQuery = "select e from Person e "
                + " where lower(e.firstname) like :query"
                + " or lower(e.lastname) like :query"
                + " or lower(e.address.city) like :query"
                + " or lower(e.address.street) like :query"
                + " or lower(e.address.postalCode) like :query";

        return entityManager
                .createQuery(jpaQuery, Person.class)
                .setParameter("query", queryStr)
                .getResultList();
        //@formatter:on
    }
95486
@GET
    @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
    @SuppressWarnings("checkstyle:illegalcatch")
    public Response search(@QueryParam("query") final String _query)
    {
        Response ret;
        try {
            final SearchResult result = org.efaps.admin.index.Searcher.search(_query);
            ret = Response.ok().type(MediaType.APPLICATION_JSON).entity(getJSONReply(result)).build();
        } catch (final Exception e) {
            LOG.error("Error processing data.", e);
            final ErrorReply reply = new ErrorReply()
                            .setError(e.getClass().getName())
                            .setMessage(e.getMessage())
                            .setStacktrace(ExceptionUtils.getStackTrace(e));
            ret = Response.serverError().type(MediaType.APPLICATION_JSON).entity(getJSONReply(reply)).build();
        }
        return ret;
    }
201465
function findElementsContainingText(query, content) {

            var results = []; // array to hold results

            // workout which property to use to get inner text
            var txtProp = ('textContent' in document) ? 'textContent' : 'innerText';

            // get the list of elements to inspect
            var elements = document.querySelectorAll(query);

            for (var i = 0, l = elements.length; i < l; i++) {
                if (elements[i][txtProp].trim() === content.trim()) {
                    results.push(elements[i]);
                }
            }

            return results;
        }
1138359
public List<FogbugzCase> searchForCases(String query) throws InvalidResponseException, NoSuchCaseException {
        HashMap<String, String> params = new HashMap<String, String>();  // Hashmap defaults to <String, String>
        params.put("cmd", "search");
        params.put("q", query);
        params.put("cols", "ixBug,tags,fOpen,sTitle,sFixFor,ixPersonOpenedBy,ixPersonAssignedTo" + // No trailing comma
                this.getCustomFieldsCSV());

        Document doc = null;
        try {
            doc = this.getFogbugzDocument(params);
        } catch (Exception e) {
            throw new InvalidResponseException(e.getMessage());
        }

        // Check for case count in cases tag, so we know wheter to parse the response ever further or not.
        int caseCount = 0;
        try {
            Node casesContainer = doc.getElementsByTagName("cases").item(0);
            caseCount = Integer.parseInt(casesContainer.getAttributes().getNamedItem("count").getTextContent());
        } catch (NumberFormatException e) {
            log.log(Level.INFO, "No valid number in case count XML response.", e);
        }
        if (caseCount < 1) {
            throw new NoSuchCaseException("Fogbugz did not return a case for query id " + query);
        }

        NodeList caseNodes = doc.getElementsByTagName("case");
        ArrayList<FogbugzCase> caseList = new ArrayList<FogbugzCase>();
        for (int i = 0; i < caseNodes.getLength(); i++) {
            caseList.add(this.constructCaseFromXmlNode(caseNodes.item(i)));
        }
        return caseList;
    }
1281064
@Override
    public QueryResult search(Query query) throws TwitterException {
        if (query.nextPage() != null) {
            return factory.createQueryResult(get(conf.getRestBaseURL()
                    + "search/tweets.json" + query.nextPage()), query);
        } else {
            return factory.createQueryResult(get(conf.getRestBaseURL()
                    + "search/tweets.json", query.asHttpParameterArray()), query);
        }
    }
738743
@SuppressWarnings("unchecked")
	static void findByNativeQuery(final EntityManager em, final String query)
    {

        Query q = em.createNativeQuery(query, Tweets.class);

        Map<String, Client> clients = (Map<String, Client>) em.getDelegate();
        ThriftClient client = (ThriftClient) clients.get("twissandra");
        client.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);

        logger.info("[On Find Tweets by CQL3]");
        List<Tweets> tweets = q.getResultList();

        System.out.println("#######################START##########################################");
        logger.info("\t\t User's total tweets:" + tweets.size());
        onPrintTweets(tweets);
        logger.info("\n");
        // logger.info("First tweet:" users.get(0).getTweets().);
        System.out.println("#######################END############################################");
        logger.info("\n");
    }
1109772
public static Evaluator parse(String query) {
        try {
            QueryParser p = new QueryParser(query);
            return p.parse();
        } catch (IllegalArgumentException e) {
            throw new Selector.SelectorParseException(e.getMessage());
        }
    }
927557
public final List<T> findSortedByQuery(String query, String sort, Object... params) {
        return this.findSortedByQuery(query, sort, (Integer) null, (Integer) null, params);
    }