I add stopWords but now i got one problem
this is my Entity
Code:
@Entity
@Table(name = "tb_comunicado", catalog = "integrabrasil", schema = "db_integra_brasil")
@SequenceGenerator(sequenceName="db_integra_brasil.tb_comunicado_seq",allocationSize=1, initialValue=0, name = "db_integra_brasil.tb_comunicado_seq")
@Indexed
@AnalyzerDef(name = "customanalyzer",
charFilters = {
@CharFilterDef(factory = HTMLStripCharFilterFactory.class),
@CharFilterDef(factory = MappingCharFilterFactory.class, params = {
@Parameter(name = "mapping", value = "br/com/dnasolution/integrabrasil/entity/mapping-chars.properties")
})
},
tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
filters = {
@TokenFilterDef(factory = LowerCaseFilterFactory.class),
@TokenFilterDef(factory = BrazilianStemFilterFactory.class),
@TokenFilterDef(factory = StopFilterFactory.class, params = {
@Parameter(name="words", value= "br/com/dnasolution/integrabrasil/entity/stoplist.properties" ),
@Parameter(name="ignoreCase", value="true")
}),
@TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = {
@Parameter(name = "language", value = "Portuguese")
})
})
public class TbComunicado implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="db_integra_brasil.tb_comunicado_seq")
@Basic(optional = false)
@Column(name = "cd_comunicado")
private Integer cdComunicado;
@Column(name="cd_cep", length=9)
@Length(max = 9)
private String cdCep;
@Column(name="ds_mais_informacoes", length=2147483647)
@Field(index=Index.TOKENIZED, store=Store.NO)
@Analyzer(definition = "customanalyzer")
private String dsMaisInformacoes;
..
and this is my search
Code:
FullTextSession fullTextSession = Search.getFullTextSession(getSessionFactory().getCurrentSession());
Transaction tx = fullTextSession.beginTransaction();
QueryParser parser = new QueryParser(Version.LUCENE_30, coluna, new BrazilianAnalyzer(Version.LUCENE_30));
FullTextQuery query = (FullTextQuery) fullTextSession.createFullTextQuery(parser.parse(valor), classe);
List<TbComunicado> result = query.list();
// tx.
return result;
when i create my index he got the word "primeiro" (first in english) and index by "prim", but when i search the word "primeiro" he change to "primeir" and don't find, anyone know why he got this different words??
sorry my english :D