[
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-267?pag...
]
Hardy Ferentschik resolved HSEARCH-267.
---------------------------------------
Resolution: Fixed
Added test case and changed code in DocumentBuilder. When a the @Field annotation is bound
no scoped analyzer should be added for this field if not explicitly defined. This will
ensure that the proper global analyzer will be used later. The old code was adding the
current global analyzer which in an inheritance scenario might be wrong.
Inheritance of annotations and analyzer
---------------------------------------
Key: HSEARCH-267
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-267
Project: Hibernate Search
Issue Type: Bug
Components: analyzer
Affects Versions: 3.0.1.GA
Reporter: Ulrich Vachon
Assignee: Hardy Ferentschik
Fix For: 3.1.0.Beta2
I have this hierarchical classes : Class0 extends Class1 extends Class2 extends Class 3
(see code example).
When I index my entity (Class0), HS don't use my CompoundMetaphoneAnalyzer to index
my property "name" but the Hibernate raw value (ie: Procaïne). If I add the
@Indexed annotation and @Analyzer to class Class2, HS use my CompoundMetaphoneAnalyzer and
my index contain the value (ie: procaine).
// class 3
public abstract class Class3 {
private Integer id;
@DocumentId
public Integer getId() {
return id;
}
}
// class 2
public abstract class Class2 extends Class3 {
protected String name;
@Fields( {@Field(name = IndexedEntity.NAME, index = Index.TOKENIZED, store =
Store.YES), @Field(name = IndexedEntity.METAPHONE, index = Index.TOKENIZED, store =
Store.YES)})
public String getName() {
return name;
}
}
// class 1
public abstract class Class1 extends Class2 {
// nothing...
}
// class 0
@Indexed
@Analyzer(impl = CompoundMetaphoneAnalyzer.class)
public class Class0 extends Class1 {
// code...
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira