@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:

I discovered that in that case, there must exist a getter method named getSearchExtendedLabel. The method name (getSearchExtendedLabel) and index name (searchExtendedLabel) are then linked.

Your very first post was implying that the method getSearchExtendedLabel exists:

I’m not following your problem, but it seems you’ve solved it, so… all is well that ends well, I guess?

Yes it is ok. Just another use case reveal that. I was lucky for searchExtendedLabel :stuck_out_tongue: