hi -
I am able to perform multiple queries and updates and everything seems to be working, with the exception of some nested IndexEmbedded entities after an update.
Here are my entities:
Code:
@Indexed
public class Strain extends BaseEntity {
@IndexedEmbedded
@OneToMany(orphanRemoval = true, cascade = CascadeType.ALL, mappedBy="strain")
private Set<TestResult> testResults = new HashSet<TestResult>();
Code:
@Entity
public class TestResult extends BaseEntity {
@ContainedIn
@ManyToOne(fetch = FetchType.LAZY, optional = false)
private Strain strain;
@IndexedEmbedded
@ManyToOne(fetch = FetchType.LAZY, optional = false)
private TestType testType;
Code:
@Entity
public class TestType extends BaseEntity {
@IndexedEmbedded
@ManyToOne(optional = false, fetch = FetchType.EAGER)
private Test test;
@ContainedIn
@OneToMany(mappedBy="testType")
private Set<TestResult> testResults = new HashSet<TestResult>();
Code:
@Entity
public class Test extends BaseEntity {
@ContainedIn
@OneToMany(fetch = FetchType.LAZY, mappedBy="test")
private Set<TestType> testTypes = new HashSet<TestType>();
I execute a search, then perform an update on some of the entities, then do another search. The data from the 2nd search is the same as the first and does not reflect the changes to the entities. So, I have stale data. Any ideas on how to refresh the data?
This is how I construct my query:
Code:
FullTextQuery fullTextQuery =
getFullTextEntityManager()
.createFullTextQuery(booleanQuery, Strain.class);
I tried calling fullTextEntityManager.flushToIndexes(); but that had no effect. I can see no SQL is being executed for the 2nd search to get the latest updates, just not sure how to enable the indexes to be updated.
I am not sure where to look, so some help is appreciated.
thanks