0

Per the API documentation, manipulating the vales of "start" and "end" will result in different data sets being returned. Strangely, changing the values of start and end resulted in the same result being returned. What am I missing? Thanks!

qopts = {'query': '/automotive and vehicles',
'aggregation' : '[term(yyymmdd).term(docSentiment.type,count:3)]',
'return': 'docSentiment.type,yyyymmdd',
'count': '50',
'start': 'now-2w',
'end' : 'now-1w',
'offset': my_offset}

my_query = discovery.query(my_disc_environment_id, my_disc_collection_id, qopts)
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Drew
  • 11
  • 3

1 Answers1

0

I hope it is helpful for you. I am not sure if this is right answer for you because I have limited information.

First of all, please check the number of return-sets. if the return-set has more then 50 dataset, result could be same. (might count param. -1 = unlimited in the rest API of WCA (Watson Context Analytics)

Second, if you can check the log from the server side, you can see the full query which manipulated from WATSON engine.

Last, I am not really sure that watson REST-API can recognize 'now-2w' style start-end form. Would you please link the tutorial? In my previous project, I wrote the start-end date by Y-M-D form.

Good Luck

Kwang-Chun Kang
  • 351
  • 3
  • 12
  • Thanks. I tried both changes, count to -1 and changing start/end fr from the "now" to the "20170101" format ... the results are the same. Is it possible that I am filtering on the wrong field -- when the data was loaded (looks like 2017-04-16T19:18:12.203Z) perhaps every document had the single load date??? Im grasping at straws. – Drew Apr 25 '17 at 12:34
  • @Newbie I have googled the [related artical](https://www.ibm.com/developerworks/library/cc-watson-discovery-service-bluemix-explore/index.html) and I found some differences between your query and the sample. Would you give me a link that you first refered ? That would be helpful for solving it together. – Kwang-Chun Kang Apr 25 '17 at 22:39
  • Thanks for the link to that article. I've been able to make it work. – Drew Apr 26 '17 at 20:16