簡體   English   中英

是否可以從URL將數據插入到Elastic Search中?

[英]Is it possible to insert data in to Elastic Search from URL?

目前,我正在從事ElasticSearch工作,並且能夠使用CMD將數據插入ElasticSearch,有一種方法可以使用java將JSON數據從Web URL插入到ELasticSerach。

是的,您可以使用rest client。 以下是代碼-

RestClient restClient = RestClient.builder(
       new HttpHost(hostname, portnumber, "http")).build();

否則,您可以使用常規運輸客戶端

TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
        .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(hostName), portNumber));

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM