Giriş
Şu satırı dahil ederiz.
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField;
Açıklaması şöyle
we annotate the fields we want to search on with the @FullTextField annotation. This annotation works only for string fields, but others exist for fields of different types.
Örnek
Şöyle yaparız
import org.hibernate.annotations.NaturalId;import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField;import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;@Indexed@Entity@Table(name = "plant")public class Plant {@FullTextField@NaturalIdprivate String name;@FullTextField@NaturalIdprivate String scientificName;@FullTextFieldprivate String family;}
Hiç yorum yok:
Yorum Gönder