TransportClient in scala

How to create transport client in Scala for Elasticsearch 5.1.1 version?

I try to create class extends on abstract class TransportClient named PreBuiltTransportClient (like in docs).

class PreBuiltTransportClient(settings: Settings) extends TransportClient(settings, new util.ArrayList[Class[_ <: Plugin]])

But Idea tell me that it can't resolve constructor.

If i try this:

class PreBuiltTransportClient(settings: Settings) extends TransportClient(settings, List().asJava)

I catch an exception with null type

you can use java client instead!

But I have project on scala, and need scala client for Elasticsearch. I can create client for Elasticsearch 2.x version, but can't for last version. I need a help :disappointed_relieved:

What is the problem?

I try to create class extends on abstract class TransportClient named PreBuiltTransportClient (like in docs).

class PreBuiltTransportClient(settings: Settings) extends TransportClient(settings, new util.ArrayList[Class[_ <: Plugin]])
But Idea tell me that it can't resolve constructor.

Can't you use the provided PreBuiltTransportClient class directly?
It's provided in this artifact:

<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>transport</artifactId>
    <version>5.1.1</version>
</dependency>

Thanks it works. :relaxed:. Really works)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.