user2739823
user2739823

Reputation: 407

Google Search Engine returns only 10 results

I have Java app which uses google search engine. Customsearch custom = new Customsearch(new NetHttpTransport(), new JacksonFactory(), httpRequestInitializer);

    Customsearch.Cse.List list = custom.cse().list("some query");
    list.setCx(cx);
    list.setKey(key);

   Search result = list.execute();
   List<Result> listResult =  result.getItems();

The problem is that listResult.size() = 10. No matters how much are results actually it returns me first 10 result.

Please help me to resolve this issue!

Upvotes: 0

Views: 374

Answers (1)

Konstantin
Konstantin

Reputation: 3294

You're not setting number of results to return and 10 is a default, api here - https://developers.google.com/resources/api-libraries/documentation/customsearch/v1/java/latest/

list.setNum(100);

Upvotes: 1

Related Questions