Hello,
thanks for your answer Emmanuel.
Still have problems with making lucene to work together with ejb3.
I created a new class who extends LuceneEventListener, to see when methods like onPostInsert,onPostUpdate,onPostDelete are called, and I register my class as listener (using persistence.xml file).
Code:
public void onPostInsert(PostInsertEvent event) {
super.onPostInsert(event);
System.out.println("[PostInsertEvent] "+event.getEntity().getClass());
}
insert event is not intercepted for my entity, defined in this way:
Code:
@Entity
@Indexed(index="index/test")
public class TestEntity {
...
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Keyword(id=true)
public int getId () {
return id;
}
...
@Text(name="name")
public String getName() {
return name;
}
Also I think automatic indexing don't work, because after inserting some records in TestEntity, I want to check if it's ok with
IndexSearcher is = new IndexSearcher("index/test");
I get FileNotFountException: index\test\segments
if I comment: @Indexed(index="index/test"), insert event is intercepted.