I have three play models which I want to index using elastic search.
The first model - model1 - includes a List of type model2 with the
following JPA mapping: @OneToMany(cascade = {CascadeType.ALL})
The second model includes a member variable of type model3 and the
following JPA settings: @ManyToOne(fetch=FetchType.EAGER,optional=false)
The third model includes a List of type model2 with JPA following
settings: @OneToMany(mappedBy="category", cascade = {CascadeType.ALL})
So it looks like this:
public class model1 extends Model{ @OneToMany(cascade = {CascadeType.ALL})
public List m2 = new ArrayList();
}
public class model2 extends Model{ @ManyToOne(fetch=FetchType.EAGER,optional=false)
public model3 m3;
}
public class model3 extends Model{ @OneToMany(mappedBy="m3", cascade = {CascadeType.ALL})
public List m2s;
}
I am indexing existing data from a database by
retrieving a list of JPA models for model1
iterating over them and calling save.
model1 and model2 are indexed successfully but the m2s member variable
in model3 does not appear to be indexed properly. In the mashup UI (es-
admin) the m2s field is listed but when I enter data nothing is
displayed.
Does elasticsearch index the data of all objects referenced by the
object you call save on?
I am new to Elasticsearch so maybe there is a better approach to
indexing linked data which I am missing.
I have three play models which I want to index using Elasticsearch.
The first model - model1 - includes a List of type model2 with the
following JPA mapping: @OneToMany(cascade = {CascadeType.ALL})
The second model includes a member variable of type model3 and the
following JPA settings: @ManyToOne(fetch=FetchType.EAGER,optional=false)
The third model includes a List of type model2 with JPA following
settings: @OneToMany(mappedBy="category", cascade = {CascadeType.ALL})
So it looks like this:
public class model1 extends Model{ @OneToMany(cascade = {CascadeType.ALL})
public List m2 = new ArrayList();}
public class model2 extends Model{ @ManyToOne(fetch=FetchType.EAGER,optional=false)
public model3 m3;}
public class model3 extends Model{ @OneToMany(mappedBy="m3", cascade = {CascadeType.ALL})
public List m2s;
}
I am indexing existing data from a database by
retrieving a list of JPA models for model1
iterating over them and calling save.
model1 and model2 are indexed successfully but the m2s member variable
in model3 does not appear to be indexed properly. In the mashup UI (es-
admin) the m2s field is listed but when I enter data nothing is
displayed.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.