Hi,
I'm trying to index null values of a nested @IndexedEmbedded(indexNullAs = Field.DEFAULT_NULL_TOKEN) @ManyToOne field, in my case its build up as:
Code:
Product.java
@ManyToOne(fetch = FetchType.LAZY)
@IndexedEmbedded()
private ProductCategory productCategory = null;
ProductCategory.java
@ManyToOne()
@IndexedEmbedded(indexNullAs = Field.DEFAULT_NULL_TOKEN)
private Category category = null;
The products do have a productCategory, but in some cases the productCategory.category values are null.
After reindexing and querying using:
Code:
criteria.must(builder.keyword().onField( "productCategory.category" ).ignoreAnalyzer().matching(org.hibernate.search.annotations.Field.DEFAULT_NULL_TOKEN).createQuery()).createQuery();
No results are returned.
Any hints on what may be wrong, or if this is possible ?
Thanks