Parent-Child mapping using JAVA client API using POJO's

(Phani Kumar Yadavilli) #1

Hi, I am a newbie working with ElasticSearch. I have been working on an application for which I would like to use ES as the backend datastore. I have POJO's or domain entities for which I would like to create a Parent-Child relation. I am using the ObjectMapper java API to serialize and deserialize the objects as json to the ES datastore. I am looking for any examples which can get me started on this. Your help is very important as well as appreciated.

(David Pilato) #2

Why do you think you need parent/child implementation? That might not be the case.

Look for example this: Book search, Parent & child mapping multiple author

(Phani Kumar Yadavilli) #3

Hi David,

Let me give you more details by an example. Let's say we have a blog post by an author but an author can have multiple blog posts. So, I would like to use the author as one index and the corresponding posts as another index. Since an author related fields may not be changed or updated very often but on the other hand the posts get added, updated very often.

(David Pilato) #4

Index only blog posts in that case.
Reindex the blog posts if your author change.

In such a usecase, you will may be reindex at most 1000 docs which is nothing.

(system) #5

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