Package de.jetwick.es

Examples of de.jetwick.es.ElasticTweetSearch.query()


                cfg.getTwitterSearchCredits().getTokenSecret(), true);
        ElasticTweetSearch fromUserSearch = new ElasticTweetSearch(injector.getInstance(Configuration.class));
        JetwickQuery query = new TweetQuery().addFilterQuery(ElasticTweetSearch.UPDATE_DT, "[* TO *]");
        // TODO set facetlimit to 2000
        query.addFacetField("user").setSize(0);
        SearchResponse rsp = fromUserSearch.query(query);

        TermsFacet tf = (TermsFacet) rsp.getFacets().facet("user");
        logger.info("found: " + tf.entries().size() + " users with the specified criteria");
        int SLEEP = 30;
        int counter = 0;
View Full Code Here


            query.attachPagability(page, hitsPerPage);
            users.clear();

            SearchResponse rsp;
            try {
                rsp = fromTweetSearch.query(users, query);
            } catch (Exception ex) {
                logger.warn("Error while searching!", ex);
                continue;
            }
            if (maxPage == 1) {
View Full Code Here

        tweetConsumer.interrupt();
        checkExceptions(exceptionMap);
        tweetSearch.forceEmptyQueueAndRefresh();

        Set<JUser> users = new LinkedHashSet<JUser>();
        tweetSearch.query(users, new TweetQuery().addFilterQuery(ElasticTweetSearch.USER, "timetabling"));
        assertEquals(2, users.iterator().next().getOwnTweets().size());

        List<JUser> res = new ArrayList<JUser>();
        tweetSearch.query(res, new TweetQuery("java"));
        assertEquals(1, res.size());
View Full Code Here

        Set<JUser> users = new LinkedHashSet<JUser>();
        tweetSearch.query(users, new TweetQuery().addFilterQuery(ElasticTweetSearch.USER, "timetabling"));
        assertEquals(2, users.iterator().next().getOwnTweets().size());

        List<JUser> res = new ArrayList<JUser>();
        tweetSearch.query(res, new TweetQuery("java"));
        assertEquals(1, res.size());

        Collection<JTweet> coll = tweetSearch.searchTweets(new TweetQuery("duplicate"));
        assertEquals(1, coll.size());
        assertEquals("duplication tweet", coll.iterator().next().getText());
View Full Code Here

                // mock this hit/result too!
                //new InternalSearchHit(1, "1", "tweet", source, fields);
                InternalSearchResponse iRsp2 = new InternalSearchResponse(
                        new InternalSearchHits(new InternalSearchHit[0], 0, 0), new InternalFacets(new ArrayList()), true);
                when(twSearch.query((Collection<JUser>) any(), (TweetQuery) any())).
                        thenReturn(new SearchResponse(iRsp2, "", 4, 4, 1L, new ShardSearchFailure[0]));

                bind(ElasticTweetSearch.class).toInstance(twSearch);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.