如下,首先,你建立的索引mapping 可以是下面这种格式,不要使用代码自动创建的,手动创建,指定字段类型为 "format": "yyyy-MM-dd HH:mm:ss", "type": "date"

{ 
  "mappings": {
    "company": {
      "properties": {
        "gmtModified": {
          "format": "yyyy-MM-dd HH:mm:ss",
          "type": "date"
        },
        "modifiedBy": {
          "type": "long"
        }
      }
    }
  }
}

然后在代码中使用:
queryBuilder.must(QueryBuilders.rangeQuery("gmtModified")
.from(gmtModified, true)
.to(gmtModified, true));

相关文章:

  • 2022-02-02
  • 2021-06-08
  • 2021-08-28
  • 2022-01-16
  • 2021-07-25
  • 2021-11-20
  • 2021-10-31
  • 2022-02-24
猜你喜欢
  • 2021-12-22
  • 2021-08-27
  • 2022-12-23
  • 2021-11-26
  • 2021-12-24
  • 2021-11-18
相关资源
相似解决方案