I have a index which need to save about 100 million docs,and the index-type have about 30 fields..
Here's what I do.
template:
{
"template": "index*",
"settings": {
"number_of_shards": 6,
"number_of_replicas": 1
},
"mappings": {
"type": {
"_all": {
"enabled": false
},
"dynamic_templates": [
{
"notanalyzed": {
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "not_analyzed"
}
}
}
],
"properties": {
"field1":{
"type": "string"
},
"field2":{
"type": "string"
},
"field3":{
"type": "string",
"index": "not_analyzed"
},
"field4":{
"type": "long"
},
"field5":{
"type": "string",
"index": "not_analyzed"
},
"field6":{
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
dsl:
{
"filtered": {
"filter": {
"bool": {
"should": [
{
"term": {
"field3": "xxx"
}
},
{
"range": {
"field4": {
"lt": "xxx",
"gte": "xxx"
}
}
}
],
"must": [
{
"term": {
"field6": "xxx"
}
}
],
"from": 0,
"sort": [
{
"field5": "asc"
}
]
}
}
}
{"term":{"field6":"?"}
,field6
about have 1 million different values,and need to be used for query every time, field4
is a time stamp,different query has different value.
server:
3 servers(ssd,98G memory,32 core cpu),each server i deploy 3 nodes,1 master node(10G heap size),2 data nodes(20G heap size).
EDIT:
I find if i use 500 thread to search,and the es
response very slow,and many search need be executed exceed 20000 millisecond,and es
search.queue
sometimes exceed 500,So i want to optimize my cluster or search dsl.