Reputation: 4094
I am executing an update with Entitymanager as follows:
Query query1 = em.createQuery("update user u set u.changed = true where u.changed is null");
query1.executeUpdate();
changed is an annoted field as follows:
@Column(nullable = false)
@Field(analyzer=@Analyzer(impl=StandardAnalyzer.class))
@FieldBridge(impl=org.hibernate.search.bridge.builtin.BooleanBridge.class)
private Boolean changed = false;
After the update the lucene index does not get updated. What do I have to do, that the lucene index gets also updated?
Kind regards Christian
Upvotes: 0
Views: 327
Reputation: 19119
Executing a SQL query is bypassing the session life cycle. For this reason the automatic index update won't work. You basically have two options:
Upvotes: 1