Hey Yoann, I just figured out this only happens when there is another abstract class in the inheritance hierarchy:
@Indexed
@Entity
...
public abstract class A {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@NumericField
@SortableField
public Long getId() {
return id;
}
...
}
@Indexed
@Entity
...
public abtract class B extends A {
...
}
@Indexed
@Entity
...
public class C extends B {
...
}
The error is then thrown for class C:
org.hibernate.search.exception.SearchException: HSEARCH000262: @NumericField annotation is used on xxx.C#id without a matching @Field annotation
at org.hibernate.search.engine.metadata.impl.NumericFieldsConfiguration.validate(NumericFieldsConfiguration.java:72)
A few questions regarding your comments about the document ID:
- Are those known issues also relevant when using Elasticsearch as backend, or only when using the old Lucene backend?
- What exactly does not work when trying to sort the document ID? Is this documented somewhere?
- Are there any other important issues with a numeric document ID you did not mention?
Thanks!! |