Structure of document affect speed?

I have a question out of curiosity. Does the structure of the document have any effect on the indexing and searching speed in an index?

Would e.g.

"user": {

take longer time than



In the example case I know the potential difference be miniscule, but imagine you have millions of docs with loads of nested data, would it have anything to say?

Unless you set up custom mappings using the nested field type, the internal representation is going to be flattened to this:

  "": "123",
  "user.first_name": "John",
  "user.last_name": "Doe"

It's functionally equivalent to the document on the bottom, so there should be no difference in performance.

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