Transient field with PropertyBinding

Hello,

I have this field definition:

@Transient
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)
@PropertyBinding(binder = @PropertyBinderRef(type = PropertiesValueBinder.class))
protected Map<String, String> properties = new HashMap<>();

But is causing problems:

HSEARCH800007: Unable to resolve path '.properties' to a persisted attribute in Hibernate ORM metadata. If this path points to a transient attribute, use @IndexingDependency(derivedFrom = ...) to specify which persisted attributes it is derived from. See the reference documentation for more information.

In my case, this transient field does not depends on another entity atribute but a value stored elsewhere. In Hibernate Search 5 I managed to implement a field bridge which retrieved this information and added to the Lucene document, but not sure how to deal with this scenario in Hibernate Search 6.

Hi,

I think your @IndexingDependency is not being applied correctly.

Can you try this?

@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO, extraction = @ContainerExtraction(extract = ContainerExtract.NO))

In this case I agree this is more complicated than it ought to be, but improvements are planned in this area (HSEARCH-4271).

Using the @IndexingDependency annotation this way seems to work. Or at least no error is given.

Thanks :slight_smile:

1 Like