弹性搜索,Filter无法使用java.sql.Time对象

loading...


0

即使查询和数据中的时间格式相同,ES仍然没有给出任何结果,请你检查并纠正我从Java处理java.sql.Time对象时的任何错误

查询示例如下:

GET /regularride/regularride/_search
    {
      "size": 5000,
      "query": {
        "bool": {
          "filter": [
            {
              "range": {
                "monday": {
                  "lt": "10:36:00 AM"
                }
              }
            },
            {
              "range": {
                "monday": {
                  "gt": "08:36:00 AM"
                }
              }
            }
          ]
        }
      }
    }

数据库中的可用数据如下所示:

{"took":1,"timed_out":false,"_shards":{"total":3,"successful":3,"skipped":0,"failed":0},"hits":{"total":45,"max_score":1,"hits":[{"_index":"regularride","_type":"regularride","_id":"26201","_score":1,"_source":{"vehicleNumber":"5656","vehicleModel":"Hatch Back","farePerKm":4,"availableSeats":4,"noOfPassengers":0,"vehicleType":"Car","cumOverlapDist":0,"riderHasHelmet":false,"fromDate":"Nov 28, 2018, 12:00:51 AM","processedDate":"Dec 11, 2018, 12:01:51 AM","duration":51,"monday":"10:06:00 AM","tuesday":"10:06:00 AM","wednesday":"10:06:00 AM","thursday":"10:06:00 AM","friday":"10:06:00 AM","dateType":"ALL"}},{"_index":"regularride","_type":"regularride","_id":"26606","_score":1,"_source":{"vehicleNumber":"cufufu","vehicleModel":"Hatch Back","farePerKm":4,"availableSeats":4,"noOfPassengers":0,"vehicleType":"Car","cumOverlapDist":0,"riderHasHelmet":false,"fromDate":"Nov 29, 2018, 12:00:00 AM","processedDate":"Dec 11, 2018, 12:01:00 AM","duration":24,"monday":"07:07:00 AM","tuesday":"07:07:00 AM","wednesday":"07:07:00 AM","thursday":"07:07:00 AM","friday":"07:07:00 AM"}}]}}

loading...

0回答

No Data

评论

暂时没有评论!