2015-10-15 181 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

相关问题