File system storage types
fs (default) simplefs niofs mmapfs hybridfs
pre-loading data into the file system cache
专家级设置,详情未来可能会改变 这个设置在 内存 小于 索引 的时候,设置不当会导致 缓存被回收,再使用,导致索引和搜索变慢
# in config/elasticsearch.yml
# ["*"]
# ["nvd", "dvd", "tim", "doc", "dim"]
index.store.preload: ["nvd", "dvd"]
PUT /my_index
{
"settings": {
"index.store.preload": ["nvd", "dvd"]
}
}
Index Sorting
nested 字段不能进行索引排序,他们被后续 doc ids 依赖。 track_total_hits
: early termination of search request
PUT twitter
{
"settings" : {
"index" : {
"sort.field" : "date",
"sort.order" : "desc"
}
},
"mappings": {
"properties": {
"date": {
"type": "date"
}
}
}
}
PUT twitter
{
"settings" : {
"index" : {
"sort.field" : ["username", "date"],
"sort.order" : ["asc", "desc"]
}
},
"mappings": {
"properties": {
"username": {
"type": "keyword",
"doc_values": true
},
"date": {
"type": "date"
}
}
}
}
# The index sort will be used to rank the top documents and each segment will early terminate the collection after the first 10 matches.
GET /events/_search
{
"size": 10,
"sort": [
{ "timestamp": "desc" }
],
"track_total_hits": false
}