You are missing a template for your value fields (non-object fields). As a result, when you add a value in your bridge here, Hibernate Search does not have any metadata about the field you’re attempting to add a value for, and cannot determine how to turn the value into JSON:
Define another template for your value fields. Something like this:
public class ResourceAttributesBinder implements PropertyBinder {
@Override
public void bind(PropertyBindingContext context) {
context.dependencies().useRootOnly();
PojoModelProperty bridgedElement = context.bridgedElement();
IndexSchemaObjectField attributeField = context.indexSchemaElement()
.objectField( bridgedElement.name() );
// ADD THIS
attributeField.fieldTemplate(
"attributeFieldValueTemplate_default",
f -> f.asString().analyzer( "english" )
);
context.bridge(Map.class,new ResourceAttributesPropertyBridge(attributeField.toReference()));
}
}
Note this is almost exactly the code of the second example in this link that I gave you in answer to your other question.