elasticsearch 弹性搜索使用“;现在";功能,elasticsearch,elasticsearch" /> elasticsearch 弹性搜索使用“;现在";功能,elasticsearch,elasticsearch" />

elasticsearch 弹性搜索使用“;现在";功能

elasticsearch 弹性搜索使用“;现在";功能,elasticsearch,elasticsearch,我在marvel中使用日期值current datetime为文档编制索引 { "category": "27", "action": "BLOCKED", "url": "https://www.deneme.com/favicon.ico", "loggingdate": "26/01/2016 16:50:55", "clientip": "

我在marvel中使用日期值current datetime为文档编制索引

{
               "category": "27",
               "action": "BLOCKED",
               "url": "https://www.deneme.com/favicon.ico",
               "loggingdate": "26/01/2016 16:50:55",
               "clientip": "10.6.1.155"
}
“2016年1月26日16:59:55”,此时此刻。。 并期望通过此查询获取此文档:

{  
  "size":"10",
  "query":{  
    "filtered":{  
      "filter":{  
        "bool":{  
          "must":[  
            {  
              "exists":{  
                "field":"category"
              }
            },
            {  
              "term":{  
                "action":"BLOCKED"
              }
            },
            {  
              "range":{  
                "loggingdate":{  
                  "gt":"now-20s"
                }
              }
            }
          ]
        }
      }
    }
  }
}
但是没有什么是不可理解的原因

如果我用id得到它:

{
   "_index": "webproxylog",
   "_type": "accesslog",
   "_id": "AVJ-iNlwfezuz1HM981V",
   "_version": 2,
   "found": true,
   "_source": {
      "category": "27",
      "action": "BLOCKED",
      "url": "https://www.deneme.com/favicon.ico",
      "loggingdate": "26/01/2016 16:50:55",
      "clientip": "10.6.1.155"
   }
}

从ES(通过其id)检索该文档时,您看到了什么?你能用索引文档更新你的问题吗?我想验证用于索引的日期格式。loggingdate似乎存储为字符串而不是日期。请共享索引的映射,好吗?