Returns the documents ranked by the score of the query or enrichment. Can be used with any query parameter or aggregation. This example returns the 10 top hits for a term aggregation.
Example:
term(enriched_text.concepts.text).top_hits(10)
Solution
[ ] add TOP_HITS to the AggregationType enum in the com.ibm.watson.developer_cloud.discovery.v1.model.query package.
[ ] create the proper deserialization of the response in the com.ibm.watson.developer_cloud.discovery.v1.model.query.QueryAggregationAdapterFactory class as well as create the appropriate models that extend the com.ibm.watson.developer_cloud.discovery.v1.model.query.QueryAggregation class (see Calculation aggregation for example)
[ ] write a test that ingests a JSON document and then uses the new TOP_HITS aggregation to create top_hits aggregation chained after a term aggregation
When you open an issue for a feature request, please add as much detail as possible:
[x] A descriptive title starting with the service name
[X] A description of the problem you're trying to solve
Description
Feature Request: Add in the
top_hits
aggregation enum for a discoveryQueryRequest
. The spec can be found at http://www.ibm.com/watson/developercloud/doc/discovery/query-reference.shtml#aggregrationsExcerpt:
Example:
Solution
TOP_HITS
to theAggregationType
enum in thecom.ibm.watson.developer_cloud.discovery.v1.model.query
package.com.ibm.watson.developer_cloud.discovery.v1.model.query.QueryAggregationAdapterFactory
class as well as create the appropriate models that extend thecom.ibm.watson.developer_cloud.discovery.v1.model.query.QueryAggregation
class (seeCalculation
aggregation for example)TOP_HITS
aggregation to create top_hits aggregation chained after a term aggregationWhen you open an issue for a feature request, please add as much detail as possible: