Elasticsearch Nested Objects with inner array of objects mapping performance?

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!

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