Hi,
I experience an issue while indexing my data in a batch.
I want to index an Article list, with some @IndexedEmbedded on members where i need to get info
Here are my beans
Article.java
Code:
@Entity
@Table(name = "article", catalog = "test")
@Indexed(index="articleText")
@Analyzer(impl = FrenchAnalyzer.class)
public class Article implements java.io.Serializable {
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
@DocumentId
private Integer id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "firstpageid", nullable = false)
@IndexedEmbedded
private Page page;
@Column(name = "heading", length = 300)
@Field(name= "title", index = Index.YES, store = Store.YES)
@Boost(2.5f)
private String heading;
@Column(name = "subheading", length = 300)
private String subheading;
@OneToOne(fetch = FetchType.LAZY, mappedBy = "article")
@IndexedEmbedded
private Articlefulltext articlefulltext;
[... bean method ...]
Page.java
Code:
@Entity
@Table(name = "page", catalog = "test")
public class Page implements java.io.Serializable {
private Integer id;
@IndexedEmbedded
private Issue issue;
@ContainedIn
private Set<Article> articles = new HashSet<Article>(0);
[... bean method ...]
Articlefulltext.java
Code:
@Entity
@Table(name = "articlefulltext", catalog = "test")
@Analyzer(impl = FrenchAnalyzer.class)
public class Articlefulltext implements java.io.Serializable {
@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "article"))
@Id
@GeneratedValue(generator = "generator")
@Column(name = "aid", unique = true, nullable = false)
private int aid;
@OneToOne(fetch = FetchType.LAZY)
@PrimaryKeyJoinColumn
@ContainedIn
private Article article;
@Column(name = "fulltextcontents", nullable = false)
@Field(store=Store.YES, index=Index.YES, analyzer = @Analyzer(impl = FrenchAnalyzer.class), bridge= @FieldBridge(impl = FulltextSplitBridge.class))
private String fulltextcontents;
[... bean method ...]
I set log4j logging level to debug :
Code:
2012-02-24;15:08:06;Version;[INFO];HSEARCH000034: Hibernate Search 4.0.0.Final
;2012-02-24;15:08:06;ConfigContext;[DEBUG];Setting Lucene compatibility to Version LUCENE_34
;2012-02-24;15:08:06;ConfigContext;[DEBUG];Using default similarity implementation: org.apache.lucene.search.DefaultSimilarity
;2012-02-24;15:08:06;DirectoryProviderHelper;[DEBUG];Initialize index: '/appli/chrusr/web/lucene/articleText'
;2012-02-24;15:08:06;WorkspaceFactory;[DEBUG];Starting workspace for index articleText using an exclusive index strategy
;2012-02-24;15:08:06;AvroSerializationProvider;[INFO];HSEARCH000079: Serialization protocol version 1.0
;2012-02-24;15:08:06;DocumentBuilderIndexedEntity;[DEBUG];Found JPA id and using it as document id
;2012-02-24;15:08:06;DocumentBuilderIndexedEntity;[DEBUG];Found JPA id and using it as document id
;2012-02-24;15:08:06;DocumentBuilderIndexedEntity;[DEBUG];Found JPA id and using it as document id
;2012-02-24;15:08:06;DocumentBuilderIndexedEntity;[DEBUG];Found JPA id and using it as document id
;2012-02-24;15:08:06;DocumentBuilderIndexedEntity;[DEBUG];Found JPA id and using it as document id
;2012-02-24;15:08:06;DocumentBuilderIndexedEntity;[DEBUG];Found JPA id and using it as document id
;2012-02-24;15:08:06;DocumentBuilderIndexedEntity;[DEBUG];Field selection in projections is set to true for entity org.litis.plair.domain.model.Article.
;2012-02-24;15:08:06;FullTextIndexEventListener;[DEBUG];Hibernate Search event listeners activated
;2012-02-24;15:08:06;FullTextIndexEventListener;[DEBUG];Hibernate Search dirty checks enabled
;2012-02-24;15:08:18;JobAltoOCRImport;[DEBUG];Beginning content update, looking in /home/plair/ptiff/xml/
;2012-02-24;15:08:20;JobAltoOCRImport;[DEBUG];done. Successfully added 1 xml files into Mysql for 1 issue(s)
When i look at the resulting lucene Index, i have some fields about both Article and Page objects, but none about ArticleFulltext, but i have correct data in my database, which means that the persist() operation is done correctly ... I really need some help here, because i don't see in what there is a difference between my Page and ArticleFullText ...