# Elasticsearch Nested Objects with inner array of objects mapping performance?

**URL:** <https://discuss.elastic.co/t/elasticsearch-nested-objects-with-inner-array-of-objects-mapping-performance/106628>\
**Category:** Elasticsearch\
**Created:** [November 7, 2017, 5:57am UTC](https://discuss.elastic.co/t/elasticsearch-nested-objects-with-inner-array-of-objects-mapping-performance/106628 "2017-11-07T05:57:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mstgrlk](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mstgrlk](https://discuss.elastic.co/u/mstgrlk)\
**Post date:** [November 7, 2017, 5:57am UTC](https://discuss.elastic.co/t/elasticsearch-nested-objects-with-inner-array-of-objects-mapping-performance/106628/1 "2017-11-07T05:57:24Z")

</div>

Hi,

I am new to elastichsearch and I want to solve my full text search problem with it. I have performance concerns about nested objects. Here is my case:

I want to generate a mapping with nested objects which contains array of objects and this array size differs from nested object to nested object. During object indexing , if I first index a nested object that contains array object with size 2, then I index a nested object that contains array object with size 4; does the nested objects with less array size reindex itself to allocate more field capacity ? Beside, I will not modify the nested object. Only index and fetch operations. For example: I have chunks of comments for each different forum posts and for each post comment, comment count differs.

**Example Indexing:**

```
ForumComments_2 = {
    'title': 'ForumPost_1',
    'batches': [
        {'id': 'comment_1', 'text': sample1''},
        {'id': 'comment_2', 'text': 'sample2'}
    ]
}

ForumComments_3 = {
    'title': 'ForumPost_2',
    'batches': [
        {'id': 'comment_12', 'text': sample5''},
        {'id': 'ecomment_22', 'text': 'sample6'},
        {'id': 'comment_32', 'text': 'sample7'},
        {'id': 'comment_42', 'text': 'sample8'}
    ]
}

**And here is the mapping:**

"mappings" : {
      "batch_comments" : {
          "properties" : {
              "title" : { 
                "type" : "text" 
              },
              "batches": {
                "type": "nested",
                "properties": {
                  "id":{
                    "type": "text"
                  },
                  "comment": {
                    "type": "text"
                  }
                }
              }
          }
      }
  }

```

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 5, 2017, 5:58am UTC](https://discuss.elastic.co/t/elasticsearch-nested-objects-with-inner-array-of-objects-mapping-performance/106628/2 "2017-12-05T05:58:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
