public class StudentEsRepository {
    // 其餘略過

    public void init() throws IOException {
        createIndex();
    }

    public void createIndex() throws IOException {
        var request = new CreateIndexRequest.Builder()
                .index(indexName)
                .build();

        client.indices().create(request);
    }
}