0 Replies - 542 Views - Last Post: 10 March 2019 - 12:48 PM

#1 ibnmvungi   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 93
  • Joined: 20-April 12

Parent Child Mapping ElasticSearch 6 Spring Boot

Posted 10 March 2019 - 12:48 PM

I am learning elasticsearch in spring boot.

I have two document which I am trying to make a relationship So as when I query a post , I get user details of that post.

User

@Document(indexName="mockup-user", type="user")
public class User implements Serializable {
    @Id
    @GeneratedValue
    private long id;
    private String name;
    private String email;
    private long createdAt;


Post

Quote

This is user post document


@Document(indexName="mockup-post", type="post")
public class Post implements Serializable {
    @Id
    @GeneratedValue
    private long id;
    private String content;
    private long createdAt;

    @Parent(type="user")
    private long id;


Am I doing it right?

is it possible to do parent child relationship in elasticsearch 6.?

is there a better way to do this.?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1