GET index_name/_search
{
"size":10,
"query":{
"match_all": {}
}
,
"sort":[
{
"occurred_at":{
"order":"desc"
}
},
{
"record_id.keyword":{
"order":"asc"
}
}
]
}
如上,不使用sort,速度是秒查,加上sort后速度很慢,4000万条数据请教优化办法!
排序字段mapping信息
"occurred_at" : {
"type" : "date",
"format" : "yyyy-MM-dd HH:mm:ss.S||yyyy-MM-dd HH:mm:ss.SS||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss||strict_date_optional_time||date_time||epoch_millis"
}
"record_id" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
3 个回复
w_b
赞同来自: Memento
lijianghu - timesaving
赞同来自:
caizhongao
赞同来自: