2017-07-06 101 views
0

我目前正在使用Watson發現中的直方圖功能,但我需要爲每個切片創建文檔,以便我可以再次對其進行處理。 (如看平均的情緒)在做直方圖時從Watson Discovery Service獲取文檔

這是我的查詢,其中我的數據分解成15分鐘塊

filter(enriched_tweet.concepts.text:"'Hockey'").histogram(extracted_metadata.utc_timestamp,interval:900000)

但響應只告訴我有多少文件在每個「切片」 。

{ 
"matching_results": 444530, 
"aggregations": [ 
    { 
     "type": "filter", 
     "match": "enriched_tweet.concepts.text:\"'Hockey'\"", 
     "matching_results": 69556, 
     "aggregations": [ 
      { 
       "type": "histogram", 
       "field": "utc_timestamp", 
       "interval": 900000, 
       "results": [ 
        { 
         "key": 1498227300000, 
         "matching_results": 180 
        }, 
        { 
         "key": 1498228200000, 
         "matching_results": 258 
        }, 

擴展到下面

所以答案,你可以對在桶中的數據,即使你不是他們似乎在搜索結果中做的動作,例如,下面的工作:

filter(enriched_tweet.concepts.text:"'Hockey'").histogram(utc_timestamp,interval:900000).sum(followers) 

我想要的是每個切片的文檔數組,然後我可以在它們上面對它們進行總結,以計算15分鐘間隔的情感。

回答

相關問題