这是我的Elastic Search 2.3.1代码:传输客户端错误

时间:2016-05-04 11:19:11

标签: elasticsearch

  

TransportClient.builder()。构建()。addTransportAddress(新   InetSocketTransportAddress(searchConfiguration.getHost()   searchConfiguration.getPort())

但我在

时遇到错误
  

searchConfiguration.getHost(),searchConfiguration.getPort()

如何传递这些参数?

1 个答案:

答案 0 :(得分:0)

<code>
TransportClient.builder().build()
    .addTransportAddress(
    new InetSocketTransportAddress(
    InetAddress.getByName(
    searchConfiguration.getHost()),
    searchConfiguration.getPort()))
</code>