@IndexingDependency : Can an Index depend on another index field?

Hi everyone,

I have an Indexed method like follows :

@Transient
@GenericField(name = MentionMicenIndexed_.LIBELLE_TITLE)
public String getLibelleTitle() {
		return String.format("%s - %s",
				estExecutoire() ? getLibelle().toUpperCase() : getNature().getLibelleCourt().toUpperCase(),
				getSearchExtendedLabel());
	}

But the method getSearchExtendedLabel() is already a @FullTextField computed with entity attributs, having its @IndexingDependency.
Do this method getLibelleTitle() has, in addition to define its own @IndexingDependency, to include (with copy paste) all @IndexingDependency of method getSearchExtendedLabel() ?

thanks.

Hey,

No it does not.

This:

@Transient
@GenericField(name = MentionMicenIndexed_.LIBELLE_TITLE)
@IndexingDependency(derivedFrom = {
        @ObjectPath(@PropertyValue(propertyName = "searchExtendedLabel"))
})
public String getLibelleTitle() {
    //...
}

will recursively add the dependencies of searchExtendedLabel to libelleTitle.

Note that in general, if you have doubts about what works or not, you can just try it :slight_smile: