Elasticsearch时间戳查询

时间:2017-04-12 07:06:26

标签: elasticsearch kibana elastic-stack elasticsearch-plugin spring-data-elasticsearch

我可以使用此命令查询elasticsearch,

<div class="item-header">

  <p class="alignleft">Author: {{post.author}}</p>
  <p class="alignright" (click)="ratingEditorClicked()">bias :{{post.bias_rating}}/5
    <ion-icon name="create" item-right></ion-icon>
  </p>

</div>

但我无法使用过滤器@timestamp&#34; 2017-04-10 00:00:00.000&#34;到&#34; 2017-04-11 23:59:59.000&#34;。任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

你可以这样做range过滤器:

 {
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "default_field": "Domain",
            "query": "edelinefs"
          }
        },
        {
          "range": {
            "timestamp": {
              "gte": "2017-04-10T00:00:00.000",
              "lte": "2017-04-11T23:59:59.000"
            }
          }
        }
      ]
    }
  }
}