Skip to content

Commit c060ffd

Browse files
alisatlgermanattanasio
authored andcommitted
added example query calls to examples/GetNewsDocumentExample.java (#227)
* added example query calls to examples/GetNewsDocumentExample.java * added provenance note to examples/GetNewsDocumentExample.java
1 parent ba55cb2 commit c060ffd

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

examples/java/com/ibm/watson/developer_cloud/alchemy_data_news/v1/GetNewsDocumentExample.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
/**
2727
* Getting 7 documents between Friday 28th August 2015 and Friday 4th September 2015 using the
2828
* {@link AlchemyDataNews} API.
29-
*
29+
*
30+
* Example from java-sdk: https://github.com/watson-developer-cloud/java-sdk
3031
*/
3132
public class GetNewsDocumentExample {
3233

@@ -44,6 +45,10 @@ public static void main(String[] args) {
4445
params.put(AlchemyDataNews.START, "1440720000");
4546
params.put(AlchemyDataNews.END, "1441407600");
4647
params.put(AlchemyDataNews.COUNT, 7);
48+
//Query on adjacent nested fields:
49+
params.put("q.enriched.url.enrichedTitle.entities.entity", "|text=IBM,type=company|");
50+
params.put("q.enriched.url.enrichedTitle.docSentiment.type", "positive");
51+
params.put("q.enriched.url.enrichedTitle.taxonomy.taxonomy_.label", "technology and computing");
4752

4853
DocumentsResult result = service.getNewsDocuments(params);
4954

0 commit comments

Comments
 (0)