When I add a new element to a Set, the Lucene index is not updated. This is the code I use:
Code:
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
Node node = (Node) session.load(Node.class, uuid);
if (!node.getKeywords().contains(keyword)) {
node.getKeywords().add(keyword);
}
session.update(node);
HibernateUtil.commit(tx);
The Node definition is:
Code:
@Entity
@Indexed
@Table(name="NODE")
public class Node {
@ElementCollection
@Column(name="KEYWORD")
@CollectionTable(name="NODE_KEYWORD", joinColumns = { @JoinColumn( name = "NKW_UUID" ) })
@Field(index=Index.UN_TOKENIZED, store=Store.YES)
@FieldBridge(impl=SetFieldBridge.class)
protected Set<String> keywords = new HashSet<String>();
}
According with these JIRA entries, seems to be solved but not for me:
-
https://hibernate.onjira.com/browse/HSEARCH-56-
https://hibernate.onjira.com/browse/HHH-2616Note: Used hibernate-core 3.6.8.Final and hibernate-search 3.4.1.Final