Best way to index base64 encoded string into ElasticSearch Best way to index base64 encoded string into ElasticSearch elasticsearch elasticsearch

Best way to index base64 encoded string into ElasticSearch


You might want to use the mapper-attachments plugin and declare your field with the Attachment field type

@Document(indexName = "user_record")public class UserRecord {    @FieldType(type = FieldType.Attachment, store = false)    private String base64UserUploadFile;...

That way the Base64 content will be indexed and searchable. I suggest not to store the content (hence store=false) if you don't want to inflate your index unnecessarily.