ライブデータのフィルタリングにelasticsearchを使用しようとしています。現在、新しいデータを常に (_bulk 経由で 3 秒ごとに) プッシュする単一のマシンを使用しています。それでも、1 日ほどでインデックスがかなり大きくなり、elasticsearch がハングするように ttl を設定しました。私の現在のマッピング:
curl -XPOST localhost:9200/live -d '{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"analyzer": {
"lowercase_keyword": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase"
]
},
"no_keyword": {
"type": "custom",
"tokenizer": "whitespace",
"filter": []
}
}
}
},
"mappings": {
"log": {
"_timestamp": {
"enabled": true,
"path": "datetime"
},
"_ttl":{
"enabled":true,
"default":"8h"
},
"properties": {
"url": {
"type": "string",
"search_analyzer": "lowercase_keyword",
"index_analyzer": "lowercase_keyword"
},
"q": {
"type": "string",
"search_analyzer": "no_keyword",
"index_analyzer": "no_keyword"
},
"datetime" : {
"type" : "date"
}
}
}
}
}'
問題は古いドキュメントのパージだと思いますが、間違っている可能性があります。セットアップを最適化する方法についてのアイデアはありますか?