javaibm-watsonwatson-discovery

Watson Discovery only returning 10 results when I query the whole collection


I'm trying to query the collection of documents with a wildcard, using Java API code as follows

QueryOptions.Builder queryBuilder = new QueryOptions
            .Builder(environmentId, collectionId);
            queryBuilder.query("text:*");
            QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult();

the result I have parsed into a json file however it only returns 10 out of the

{
  "matching_results": 17,
...
}

17 results,

how do I get all 17 result to display in Json format?


Solution

  • found the answer on the docs that I missed:

    queryBuilder.query("text:*").count(17);