简体   繁体   中英

Twitter4J android query search does not return all tweets

I am working on the Twitter Android Application with Twitter4J library. Streaming API's are working fine. But the search API is not returning all the tweets, some of the tweets in between are skipped and not found in the search results.

I am querying with the query("from:handle") , I checked with the Twitter page of respective handle, not all the tweets on page are present in the search result. Most of the tweets with images are missed.

Below is the code which i am using.

    String handle = "ndtv";
    Query query = new Query("from:"+handle);
    query.setCount(100); // Limit of resultset
    QueryResult result = twitter.search(query);
    System.out.println("Count : " + result.getTweets().size()) ;
    for (Tweet tweet : result.getTweets()) {
        System.out.println("text : " + tweet.getText());
    }

Anyone faced similar issues with twitter4j? Or is there any limitations with twitter search API.?

From here :

it's important to know that the Search API is focused on relevance and not completeness . This means that some Tweets and users may be missing from search results. If you want to match for completeness you should consider using a Streaming API instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM