GET <index-name>/_search
{
“size”: 1,
“sort”: [
{
“Date”: {
“order”: “desc”
}
}
]
}
感谢!
GET <index-name>/_search
{
“size”: 1,
“sort”: [
{
“Date”: {
“order”: “desc”
}
}
]
}
感谢!
public SearchSourceBuilder build(){
SearchSourceBuilder builder = new SearchSourceBuilder();
BoolQueryBuilder query = QueryBuilders.boolQuery();
builder.sort(new FieldSortBuilder("Date").order(SortOrder.DESC));
builder.query(query);
builder.size(1);
return builder;
}