Rati
Rati

Reputation: 45

Inner object vs denormalization in Elastic search

I need to know which one will be faster and why.

Case 1 : inner Objects

 {
  "name":"Zach",
  "car":{
    "make":"Saturn",
    "model":"SL"
  }
}

Case 2 :

{
  "name":"Zach",
  "carmake":"Saturn",
  "carmodel":"SL"
}

I have gone through the link https://www.elastic.co/blog/managing-relations-inside-elasticsearch, It says that inner object are fast. But is it faster than denormalized objects? Why there is always one to one relationship b/w name and car.

Upvotes: 1

Views: 1922

Answers (1)

bittusarkar
bittusarkar

Reputation: 6357

You need to read https://www.elastic.co/blog/managing-relations-inside-elasticsearch more carefully. It has answers to all your questions. It mentions that internally inner objects are all flattened. Hence both versions are exactly the same with respect to performance.

Upvotes: 2

Related Questions