Oki,
Surely this lack of information.
Environment : hibernate-search 3.2.1.Final
spring 3.0.4.RELEASE
Entity :
GuichetCode:
@Entity
@Table(name = "XXX")
@Indexed
@AnalyzerDef(name = "analyzerGuichet",
tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
filters = {
@TokenFilterDef(factory = ISOLatin1AccentFilterFactory.class),
@TokenFilterDef(factory = LowerCaseFilterFactory.class),
@TokenFilterDef(factory = ASCIIFoldingFilterFactory.class)
})
@Analyzer(definition = "analyzerGuichet")
public final class Guichetimplements Serializable {
@Field(index = Index.TOKENIZED, store = Store.YES)
@Column(name = "C_NOMGUICHET")
private String nomGuichet;
...
@IndexedEmbedded(depth = 1)
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "F_IDETABLISSEMENTPRETEUR")
private OrganismePreteur organismePreteur;
}
OrganismePreteurCode:
@Entity
@Table(name = "XXX")
public final class OrganismePreteur implements Serializable {
@Field(index = Index.TOKENIZED, store = Store.YES)
@Column(name = "C_LIBELLE")
private String denomination;
...
@ContainedIn
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "F_IDETABLISSEMENTPRETEUR", nullable = true)
private Set<Guichet> guichets;
}
Une rechercheCode:
final FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(this.getEntityManager());
final String[] fields = new String[] { "organismePreteur.denomination", "nomGuichet"};
final Analyzer analyzer = fullTextEntityManager.getSearchFactory().getAnalyzer(Guichet.class);
final MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_29, fields, analyzer);
query = parser.parse(mots);
...
... BoolezanQuery for fuzzyQuery ... etc..
FullTextQuery persistenceQuery = fullTextEntityManager.createFullTextQuery(booleanQuery, Guichet.class);
persistenceQuery.getResultList();
If I have a bank named A which has two Agencies , the search "A" reference the two agencies
It looks normal but does not agree with me on big result.
How could I know that referenced the result ?
NOTE : sorry for my english