Elasticsearch client for 1.6 java and 1.5.0 version of server


(Vladimir) #1

Hello!

Is it possible to setup next configuration :
Client on java 1.6(! that's impossible to upgrage to 1.7 :((( )
server - 1.4.2

As I unserstand - we should use 1.2.0 version of jar for 1.6 java, but it doesn't work with our server(btw, 1.5 works fine).
(org.elasticsearch.client.transport.NoNodeAvailableException: No node available)

What can we do? We need only bulk insert, that's all.

One way what I see - downgrade server to 1.2(or what correct?), but I don't think that this is a good idea.
Can we fix some code(where??)

Thans a lot!
Vladimir


(Magnus B├Ąck) #2

Can't you use the REST client (possibly via JEST)? It doesn't have any such hard version dependencies between client library and server.


(Vladimir) #3

oh, thank you for a quick answer!)
look's like it have bulk operations
I'll try it tomorrow


(Vladimir) #4

Hello!

We've tried this(Jest), with the simple test - 5 iterations/ 10000 objects by 1Kb

for (int j = 0; j < 5; j++) {
        long l = System.currentTimeMillis();
        Bulk.Builder builder = new Bulk.Builder().defaultIndex(INDEX).defaultType(TYPE);
        for (int i = 0; i < 10000; i++) {
            Map<String, String> source = new LinkedHashMap<String, String>();
            source.put("user", "kimchy");
            //        source.put("postDate", new Date().toString());
            source.put("message", VALUE);
            source.put("date", String.valueOf(new Date().getTime()));
            builder.addAction(new Index.Builder(source).build());
        }
        Bulk bulk = builder.build();

        JestResult execute = client.execute(bulk);
        long l1 = System.currentTimeMillis();
        System.out.println(Thread.currentThread().getName() + ";Duration=" + (l1 - l));
    }

Elasticsearch api(1.5.0)
main;Duration=1234
main;Duration=771
main;Duration=744
main;Duration=583
main;Duration=674

and jest api:
main;Duration=2793
main;Duration=1976
main;Duration=1860
main;Duration=1917
main;Duration=2292

as you see Jest is 2-3 times slower then core elasticsearch API...

Please, any ideas? :slight_smile:


(system) #5