2015-10-15 128 views
0

我查詢的elasticsearch(2.0)集羣和希望得到的事件比一個特定的一個(2015年8月在下面的情況下,30)更久的時間戳:爲什麼這個範圍查詢返回空結果?

POST /constant_scan/vulnerability/_search 
{ 
    "query":{ 
     "filtered":{ 
     "filter":{ 
      "range":{ 
       "HOST_START_iso":{ 
        "lt":"2015-08-30" 
       } 
      } 
     } 
     } 
    } 
} 

此搜索返回

{ 
    "took": 44, 
    "timed_out": false, 
    "_shards": { 
     "total": 5, 
     "successful": 5, 
     "failed": 0 
    }, 
    "hits": { 
     "total": 0, 
     "max_score": null, 
     "hits": [] 
    } 
} 

DB有相關記錄。一種用於所有元素的查詢返回,除其他外,具有時間戳的條目8月20日(早於8月30日)

{ 
    "took": 241, 
    "timed_out": false, 
    "_shards": { 
     "total": 5, 
     "successful": 5, 
     "failed": 0 
    }, 
    "hits": { 
     "total": 58517, 
     "max_score": 1, 
     "hits": [ 
     { 
      "_index": "scan_constant", 
      "_type": "vulnerability", 
      "_id": "10.89.0.103", 
      "_score": 1, 
      "_source": { 
       "private": true, 
       "authenticated": false, 
       "HOST_START_iso": "2015-08-20T10:19:24+00:00" 
      } 
     }, 
     (...) 

我試圖用一個完整的ISO日期作爲分隔符,試圖lte,而不是lt - 同結果。搜索事件更新的日期產生相同(也有在該日期兩邊事件)(根據

回答

1

你查詢constant_scan指數

POST /constant_scan/vulnerability/_search 

,而你的文件存儲在scan_constant指數爲您提供的樣本文件)

嘗試張貼您的查詢到這個網址,而不是:

POST /scan_constant/vulnerability/_search 
+0

謝謝你 - 我會離開我的問題作爲腦的一個里程碑(並在9分鐘內接受) – WoJ

+0

不用擔心,沒有愚蠢的問題! – Val