Hi!
Tried to add two paths into derivedFrom
, but I get an error:
org.hibernate.search.util.common.SearchException: HSEARCH700078:
No readable property named ‘parent.name’ on type ‘com.thevegcat.app.entities.provider.Provider’.
What is the syntax to put a reference to name
property of parent
property?
I see there is additional extraction
property of @PropertyValue
on top of propertyName
, but I can’t find how to use it.
@Entity @Indexed class Provider { @FullTextField private LocalizedField name; @ManyToOne( fetch = FetchType.LAZY ) private Priovider parent; @Transient @IndexingDependency( derivedFrom = { @ObjectPath(@PropertyValue(propertyName = "name")), @ObjectPath(@PropertyValue(propertyName = "parent.name")) } ) @KeywordField(name = "sortableTitle", projectable = Projectable.NO, searchable = Searchable.NO, sortable = Sortable.YES) public String getSortableTitle() { String name = this.name.get(LocaleUtil.SORT_LOCALE); if (this.parent == null) { return name; } return this.parent.name.get(LocaleUtil.SORT_LOCALE) + '.' + name; } }