这里我使用这段代码从时间戳为>= 1656055230028的索引中读取数据:
Source<ReadResult<Map<String, Object>>, NotUsed> source =
ElasticsearchSource.create(
constructElasticsearchParams("data", "_doc", ApiVersion.V7),
" "range": {" +
" "timestamp": {" +
" "gte": 1656055230028" +
" , "boost": 2.0" +
" }" +
" }",sourceSettings);
返回0结果,但是在Elastic开发工具上使用查询:
GET /data/_search
{
"query": {
"range": {
"timestamp": {
"gte": 1656055230028,
"boost": 2.0
}
}
}
}
返回数据。
上面Java代码中使用的请求格式是否正确?
查询正常运行:
"{ "bool": { "must" : [{"range" : {"+
""timestamp" : { "+
""gte" : 1656055230028
+" }} }]}} "