每次运行批量对1000条数据建立索引前,都删掉原来的索引!结果每次运行完查询,每次的生成的索引条数都不一样,而且每次都没有达到1000条!bulkResponse.hasFailures()这个也没有说有错误。多次运行的时候经常还会出现空指针异常,如下:Exception in thread "main" java.lang.NullPointerException
at org.elasticsearch.action.bulk.BulkRequest.validate(BulkRequest.java:496)
at org.elasticsearch.action.TransportActionNodeProxy.execute(TransportActionNodeProxy.java:46)
at org.elasticsearch.client.transport.support.TransportProxyClient$1.doWithNode(TransportProxyClient.java:58)
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:212)
at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55)
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:288)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:359)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:86)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:56)
at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:64)
望大神们,能指点一下?
at org.elasticsearch.action.bulk.BulkRequest.validate(BulkRequest.java:496)
at org.elasticsearch.action.TransportActionNodeProxy.execute(TransportActionNodeProxy.java:46)
at org.elasticsearch.client.transport.support.TransportProxyClient$1.doWithNode(TransportProxyClient.java:58)
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:212)
at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55)
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:288)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:359)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:86)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:56)
at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:64)
望大神们,能指点一下?
0 个回复