Hello all,
we currently upgraded hibernate search to 3.3.0.Final to be able to simplify null values indexing with
idexNullAs property of
@Field annotation. However we can't get it working with an embedded entity using
@IndexedEmbedded without a field bridge. An example worth a 1000 words is joint below :)
Code:
@Indexed
@Entity
public class A {
@Id
private Long id;
@Field(indexNullAs = Field.DEFAULT_NULL_TOKEN)
private String simpleProperty;
@Field(indexNullAs = Field.DEFAULT_NULL_TOKEN)
@IndexedEmbedded
private B complexProperty;
}
@Entity
public class B {
@Id
private Long id;
@Field
private String anotherProperty;
}
This code will throw '
org.hibernate.search.SearchException: Unable to guess FieldBridge for B' exception while indexing (but will work like a charm for a simple String property). We are obliged to add a FieldBridge for B then and manage nulls indexing inside anyway.
Are we using those annotations in a wrong way? Is the exception due to some technical constraint or can this feature be logged as an evolution for future versions?
Thanks in advance for your help and opinions!