i have problem :
i have got class:
Code:
@MappedSuperclass
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class AUser implements Serializable, Cloneable
{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@DocumentId
private long id;
@Field
private String title;
@Field
private String description;
//getters setters etc
}
Code:
@Indexed
public class TPerson extend AUser
{
public static TPerson()
{
super();
}
public TAlbum(
String title,
String description
)
{
super(title,description);
}
//getters setters etc
}
@Indexed
public class Person extends AUser
{
private static final long serialVersionUID = 1L;
@OneToMany
@JoinColumns({
@JoinColumn(name="personId", referencedColumnName="id")
})
@IndexedEmbedded
private List<TPhoto> photos;
//getters setters etc
}
public class Photo implements Serializable, Cloneable
{
private long id;
private long personId;
@Field
private String title;
//getters setters etc
}
And as you see class TPerson have got the same field as AUser and when i insert, update TPerson in entityManager is automaticaly indexed (see in Luke ) and everything is ok.
but when i remove or update TPerson indexed are still in Indexed Strore ??
when i update new words are indexed but old word not deleted ??
But what i must do to automatic indexed class Person because i need to indexed class Person not TPerson??
And i have one more question when i update , delete or insert new Photo (new field title in Photo) that means automaticaly indexed this field ??
My property in persistence.xml
Code:
<properties>
<!-- use a file system based index -->
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider"/>
<!-- directory where the indexes will be stored -->
<property name="hibernate.search.default.indexBase" value="/usr/local/storage/pte/photoservice/searchindex"/>
<property name="hibernate.ejb.event.post-insert" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-update" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-delete" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.search.worker.batch_size" value="2000" />
<property name="hibernate.search.default.refresh" value="9000" />
</properties>