How to store (retrieve) files (txt) in elasticsearch using spring data?

Viewed 118

I am developing an application that uses elasticsearch as a database and I would like to store text files, here is my java entity.

@ToString
@Getter
@Setter
@Document(indexName = "patterns")
public class Pattern {
    @Id
    private String id;
    private String name;
    private String status;
    // How I can store this file in elasticsearch?, what type I should use for the field patternFile.
    private File patternFile; 
}

How can I do that using spring data elasticsearch ?.

0 Answers
Related