From 92bc9fab67f31962a4e7702224d4fc79cbb6c50c Mon Sep 17 00:00:00 2001 From: Alisa Zhila Date: Thu, 7 Apr 2016 16:44:53 -0400 Subject: [PATCH 1/2] added example query calls to examples/GetNewsDocumentExample.java --- .../alchemy_data_news/v1/GetNewsDocumentExample.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java b/examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java index d27ca7eb014..3889ef5258d 100644 --- a/examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java +++ b/examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java @@ -44,6 +44,10 @@ public static void main(String[] args) { params.put(AlchemyDataNews.START, "1440720000"); params.put(AlchemyDataNews.END, "1441407600"); params.put(AlchemyDataNews.COUNT, 7); + //Query on adjacent nested fields: + params.put("q.enriched.url.enrichedTitle.entities.entity", "|text=IBM,type=company|"); + params.put("q.enriched.url.enrichedTitle.docSentiment.type", "positive"); + params.put("q.enriched.url.enrichedTitle.taxonomy.taxonomy_.label", "technology and computing"); DocumentsResult result = service.getNewsDocuments(params); From 45a40fc40ee5866e94fa9e259034b04fb96cb838 Mon Sep 17 00:00:00 2001 From: Alisa Zhila Date: Thu, 7 Apr 2016 17:29:09 -0400 Subject: [PATCH 2/2] added provenance note to examples/GetNewsDocumentExample.java --- .../alchemy_data_news/v1/GetNewsDocumentExample.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java b/examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java index 3889ef5258d..7b5b3fab4de 100644 --- a/examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java +++ b/examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java @@ -26,7 +26,8 @@ /** * Getting 7 documents between Friday 28th August 2015 and Friday 4th September 2015 using the * {@link AlchemyDataNews} API. - * + * + * Example from java-sdk: https://github.com/watson-developer-cloud/java-sdk */ public class GetNewsDocumentExample {