Hey,
I’m not quite sure what you are trying to achieve precisely…
From the error message you’ve provided, I could’ve suggested looking at the ValueBridge#isCompatibleWith(ValueBridge)
if the indexes combined in the scope are actually compatible…
But if you are trying to search against multiple indexes at the same time and those are using different enums, and you want them to “look the same”, then maybe try something like this instead:
@Enumerated
private MyEnum myEnum; // no @KeywordField
@KeywordField(sortable = Sortable.YES) // create a derived property which will be a string
@IndexingDependency(derivedFrom = @ObjectPath(@PropertyValue(propertyName = "myEnum"))) // tell Hibernate Search what this field is derived from so that indexing works correctly
public String getMyEnumString() {
return myEnum == null ? null : myEnum.name();
}
This way, the field will be a string from the beginning, and no value conversion will be needed…