Can we give parent/child relation ship between different indexes

(anusha) #1

I would like to give parent/ child relationship between three different indexes,
where indexes are index1, index2, index3 with different types in those indexes..
May I know is it possible???

(Mark Walkom) #2

No you cannot.

Needs to be done in the same index, and specifically, in the same shard.

(anusha) #3

How to know that my data is in a particular shard? and how can I keep in the same shard???????????

where my settings having following information regarding shards as shown:

"number_of_shards": "5",
"version": {
"created": "1050299"

(Patrick Kik) #4

Wanting to have parent/child relations between indexes is, I think, a smell of a bad data model. It looks to me you are storing different entities in different locations. Perhaps you should aggregate those entities together.

(Patrick Kik) #5

With regard to your routing question, see

(anusha) #6

Hi Patrick,
Then what about the shards as Mark mentioned???? May I know what exactly the shards do???

(anusha) #7

How can I maintain the data in the same shard and how to know that in which shard my parent data is stored..??????

(anusha) #8

@warkolm and @PatrickKik Thanks for your reply, and I came to know what exactly the data need to be in same shard. This helps me to sort the problem.

Thank you..

(anusha) #9

And can we have more than one parent in a child type???

(Patrick Kik) #10

You can have one parent per child. It saves you the horrors of conflicting multiple inheritance.

(anusha) #11

Okay Thank you Patrick..

Parent - child in separate indices
(system) #12