I have my entity class defined as follows:
@Document(indexName = "payload-pojo")
public class PayloadPojo {
@Id
private String id;
@Field(index = false,type = FieldType.Binary)
byte[] payload;
}
and the Repository defined as follows:
public interface PayloadRepository extends ElasticsearchRepository<PayloadPojo, String> {
}
In the ES 6.8.1 (Spring Data Elasticsearch 3.2.0) I managed to store and read the binary data without any problem.
Now I'd like to move to ES 7.5.2, so I migrated the project to use Spring Data Elasticsearch 4.0.0. Since then when I try to call something like payloadRepo.findAll()
I get conversion exception:
Failed to convert from type [java.lang.String] to type [byte]
.
The data is stored as base64 encoded string.
Do you have any idea of what has changed and how to change my code in order to read this value correctly?
Thanks