Hi,
I have one index in nested mapping structure with total of 35 million records . I am using some nested columns for searching also. When searching with nested fields, application is taking more time to respond for the first time. Second time its faster because of cache. Also I am doing some aggregations in the same search query itself. I need to speed up the search with nested columns. Can anybody have tips to improve the searching speed with nested columns.
Note : Some document have more than 10K nested objects. I am using PHP SDK for integrating the ES in my application. These nested search column have mapped with " index => true " option.
Please find server details :
ES Version : Elasticsearch 6.3.1
Server RAM : 256 GB
Harddisk : SSD 2 TB
Java Heap : 10 GB
Please find the sample mapping json for reference. This is not the original one, actual one having more fields.
{
"index": "index_name",
"body": {
"settings": {
"refresh_interval": "30s",
"index.mapping.total_fields.limit": 1000000,
"analysis": {
"normalizer": {
"case_insensitive": {
"type": "custom",
"filter": [
"lowercase"
]
}
}
}
},
"mappings": {
"type_name": {
"properties": {
"field_1": {
"type": "keyword",
"index": "true"
},
"field_2": {
"properties": {
"data1": {
"type": "keyword",
"index": "true"
},
"data2": {
"type": "keyword"
}
}
},
"filed_3": {
"type": "nested",
"properties": {
"data_array_1": {
"type": "nested",
"properties": {
"data1": {
"type": "long"
},
"data2": {
"type": "keyword",
"index": "true"
},
"data3": {
"type": "keyword"
}
}
}
}
},
"field_4": {
"type": "nested",
"properties": {
"data_array_2": {
"properties": {
"data1": {
"type": "keyword"
},
"data2": {
"type": "keyword"
}
}
}
}
},
"field_5": {
"type": "nested",
"properties": {
"metadata": {
"properties": {
"data1": {
"type": "keyword"
},
"data2": {
"type": "keyword"
}
}
},
"metadata_1": {
"type": "nested",
"properties": {
"metadata_2": {
"type": "nested",
"properties": {
"data1": {
"type": "keyword",
"index": "true"
}
}
},
"metadata_3": {
"type": "nested",
"properties": {
"data1": {
"type": "keyword",
"index": "true"
},
"data2": {
"type": "long"
}
}
},
"metadata_4": {
"type": "nested",
"properties": {
"data1": {
"type": "keyword",
"index": "true"
},
"data2": {
"type": "long"
},
"data3": {
"type": "keyword",
"index": "true"
}
}
}
}
}
}
}
}
}
}
}
}