用了Elasticsearch,一口气上5T

siren-join java api出错

Elasticsearch | 作者 lbeny | 发布于2016年11月07日 | 阅读数:3235


   使用siren-join 2.2.0-1 ,这样访问无问题
curl -XGET 'http://172.22.1.104:9200/sp_gf/_coordinate_search?pretty' -d '{ "query" : {"filtered" : {"query" : {"match_all" : { }},"filter" : {"filterjoin" : {"s_1_yb" : {"indices" : ["sp_c"],"path" : "s_1_yb","query" : { "term" : {"s_1_yb" : "512099"}}}}}}}}'
    
    用java api访问就会出错,代码如下:
                SearchResponse sr = new CoordinateSearchRequestBuilder(client).setIndices("sp_gf").setQuery(                QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery()

                        ,solutions.siren.join.index.query.QueryBuilders.filterJoin("s_1_yb").indices("sp_c").path("s_1_yb").query(                                QueryBuilders.termQuery("s_1_yb", "512099")))).setSize(1000).execute().actionGet();
    There is the exception:
    java.lang.NullPointerException
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:286)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:351)
at solutions.siren.join.action.coordinate.CoordinateSearchRequestBuilder.execute(CoordinateSearchRequestBuilder.java:36)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)
at com.sophon.search.text.SearchTest.testSearchSirenjoin(SearchTest.java:2537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

检查很多遍没发现代码的问题,不知道什么原因求大神解答
已邀请:

要回复问题请先登录注册