I want to partial update doc,but i also want a good performace,so I tried 2
way to test ,one is by http rest api,the other is by java api version0.90;
java_version:1.6.20
es_version:0.90.1

HTTP REST:
http://127.0.0.1:9200/_bulk

{"update":{"_index":"mobile","_type":"mobile_property_mid","_id":"15141307986"}}
/n
{"doc":{"consume_vol_tot":"0.0","last_login_date":"2012-06-27","login_days_3month":"0","log_avg_interval_half_year":"0.0","consume_days_3month":"0"}}
/n
{"update":{"_index":"mobile","_type":"mobile_property_mid","_id":"15141308091"}}
/n
{"doc":{"consume_vol_tot":"0.0","last_login_date":"2012-12-26","login_days_3month":"0","log_avg_interval_half_year":"0.0","consume_days_3month":"0"}}
/n 

JAVA API:

bulkRequest.add(client.prepareUpdate(indexName,
indexTypeName,key).setUpsertRequest(builder.endObject()).setScript(updateScript.toString()).setFields("_source"));
BulkResponse bulkResponse = bulkRequest.execute().actionGet();

Here is the test result:
http rest:
bulk nums:8000,cost time:1306
bulk nums:8000,cost time:1348
bulk nums:8000,cost time:1320
bulk nums:8000,cost time:1277
bulk nums:8000,cost time:1214
bulk nums:8000,cost time:1336
bulk nums:8000,cost time:1338
bulk nums:8000,cost time:1399
bulk nums:8000,cost time:1231
bulk nums:8000,cost time:1280
bulk nums:8000,cost time:1482
bulk nums:8000,cost time:1248
bulk nums:8000,cost time:1394

java api:
bulkResponse items8000,cost time:5252
bulkResponse items8000,cost time:5171
bulkResponse items8000,cost time:5077
bulkResponse items8000,cost time:5230
bulkResponse items8000,cost time:5469
bulkResponse items8000,cost time:5898
bulkResponse items8000,cost time:5443
bulkResponse items8000,cost time:5579
bulkResponse items8000,cost time:5026
bulkResponse items8000,cost time:5279
bulkResponse items8000,cost time:5851
bulkResponse items8000,cost time:5708
bulkResponse items8000,cost time:5115

So why is java api way so slower than http?
And How can I slove it?I read l a lot doc,but can't found the answer.



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/Performance-about-api-between-http-api-and-java-api-tp4064935.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1413426451814-4064935.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to