Performance about api between http api and java api?

2014-10-15 Thread zouxcs
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 elasticsearch+unsubscr...@googlegroups.com.
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.


Re: elasticsearch java update api error

2014-09-28 Thread zouxcs
Yeah,that's right,I changed to setScript and it works,thank you for the help.



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/elasticsearch-java-update-api-error-tp4064139p4064151.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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1411892081116-4064151.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: elasticsearch java update api error

2014-09-27 Thread zouxcs
I set the script manually,the updateScriptLang is like
"ctx._source.field1=\""+string+"\";ctx._source.field2="+Integer+";"



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/elasticsearch-java-update-api-error-tp4064139p4064146.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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1411883868225-4064146.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: elasticsearch java update api error

2014-09-27 Thread zouxcs
The client and the node are both version 0.90.1



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/elasticsearch-java-update-api-error-tp4064139p4064143.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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1411883310287-4064143.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.


elasticsearch java update api error

2014-09-27 Thread zouxcs
I use script to partial update my doucument by java.
here is the java code;

bulkRequest.add(client.prepareUpdate(indexName,
indexTypeName,key).setScriptLang(updateScriptLang.toString()));

and my elasticsearch version is 0.90.1 and the java version is jdk_1.6.0_20

Here is the error:
org.elasticsearch.transport.TransportSerializationException: Failed to
deserialize exception response from stream
at
org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:168)
at
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:122)
at
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
at
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
at
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:310)
at
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
at
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at
org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.io.EOFException
at
java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
at
java.io.ObjectInputStream.skipCustomData(ObjectInputStream.java:1942)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1916)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.access$300(ObjectInputStream.java:206)
at
java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2151)
at java.io.ObjectInputStream.readFields(ObjectInputStream.java:538)
at java.net.InetSocketAddress.readObject(InetSocketAddress.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectI

Re: Something like Wildcard Filter?

2014-07-31 Thread zouxcs
I have the same question now,how did you solve it?give me a hint.Thank you



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/Something-like-Wildcard-Filter-tp2613862p4060937.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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1406773485496-4060937.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.


How I sort these jsons using java api?

2014-07-28 Thread zouxcs
"sort" : [
   {
  "pt_float_props.value" : {
 "order" : "desc",
 "nested_filter" : {
"term" : {  "pt_float_props.name": "consume_vol_tot" }
 }
  }
   },  {
  "pt_str_props.value" : {
 "order" : "desc",
 "nested_filter" : {
"term" : {  "pt_str_props.name": "last_login_date" }
 }
  }
   }
]

I find java api that maybe i could use ScriptSortBuilder,but i'm not sure
about that.



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/How-I-sort-these-jsons-using-java-api-tp4060705.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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1406533143877-4060705.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.