Hello,
I'm doing a searcher with Hibernate Search and I need to solve one question.
I have a main class: XxsgcExperts
Code:
@Indexed
public class XxsgcExperts implements java.io.Serializable {
@DocumentId
private BigDecimal idExperto;
@ContainedIn
private Set xxsgcPublicacioneses = new HashSet(0);
@Field(index = Index.TOKENIZED, store = Store.NO)
private String nombre;
.....
(rest o the bean)
}
that has some relactions as the next:
Code:
<set name="xxsgcPublicacioneses" table="XXSGC_PUBLICACIONES" inverse="true" lazy="true" fetch="select">
<key>
<column name="ID_EXPERTO" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="es.il3.sigec.model.beans.XxsgcPublicaciones" />
</set>
and the class XxsgcPublicaciones is here:
Code:
@Indexed
public class XxsgcPublicaciones implements java.io.Serializable {
@DocumentId
private BigDecimal idPublicacion;
@IndexedEmbedded
private XxsgcExperts xxsgcExperts;
.....
@Field(index = Index.TOKENIZED, store = Store.NO)
private String tituloEs;
@Field(index = Index.TOKENIZED, store = Store.NO)
private String tituloCa;
}
I launch the indexer over XxsgcExperts and XxsgcPublicaciones and all it's ok, but I need do something that I don't know if it's possible.
I'd like to search from the XxsgcExperts to the fields of XxsgcExperts and XxsgcPublicaciones. This is, I need do something who
Code:
final MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_30,"nombre,xxsgcPublicacioneses.tituloEs ", analyzer);
I've seen that with Luke, from XxsgcPublicaciones, you could search on XxsgcExperts fields, but I have to do the opposite and do not know if possible.
Thanks a lot and sorry for my english!!