搜索结果正在快递途中

关于es,用字符串的多字段排序,例如使用title.sort排序,是基于docvalues吗?

Elasticsearch | 作者 hkdlishenbo | 发布于2018年07月30日 | 阅读数:7725

es为了实现字符串即能分词又能排序,可以设置多字段。如下:
"title": {
"type": "string",
"analyzer": "ansj",
"fields": {
"sort": {
"type": "string",
"index": "not_analyzed"
}
}
}

我们就可以通过title字段作为搜索,而用title.sort字段作为排序:
GET /_search
{
"query": {
"match": {
"title": "elasticsearch"
}
},
"sort": "title.sort"
}
我想问,使用title.sort排序,是基于docvalues 还是fielddata,还是别的什么?
已邀请:

kennywu76 - Wood

赞同来自: hkdlishenbo

title.sort是not_analyzed类型的string,相当于5.x之后版本的keyword, 排序时用的是doc values。

yayg2008

赞同来自:

string类型是没有docvalues的,排序时是用fielddata。

要回复问题请先登录注册