Hello friends, I'm trying to use hibernate search and I like it a lot, but when I use the @ContainedIn annotation to map a @OneToMany field I don't get the right return in the search.
My field is this:
Code:
@ContainedIn
public Set<PalavraChave> getPalavraschave() {
return palavraschave;
}
and my object 'PalavraChave' is annotated with the @Indexed, @DocumentId and @Field annotations, but when I try to search like this:
Code:
String[] fields = new String[]{"nomePopular", "palavraschave.descricao"};
MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, new StandardAnalyzer());
Query query = parser.parse(nome);
//FullTextQuery ftq = fullTextEntityManager.createFullTextQuery(query, PalavraChave.class);
FullTextQuery ftq = fullTextEntityManager.createFullTextQuery(query, Servico.class);
teste = ftq.getResultList();
The search doesn't return any object, and when I try to search by the 'nomePopular' (String), the return was right.
So, What am I doing wrong?
Thanks!