Hey, when you run NodeBuilder.nodeBuilder().node().client() - you are actually starting another elasticsearch instance. Is that intended? Why are returining JSON data, when executing java classes (I am a bit confused).
Can you create a gist, which only contains curl calls or only contains a Java API in order to rule out you run two different instances? Thanks! --Alex On Sun, Jan 12, 2014 at 5:51 AM, Sandeep Jain <[email protected]> wrote: > Hi, > > After version upgrading to 0.90.10, I am facing a issue in > SearchScrollRequestBuilder when query having parent filters, the response > having the following failure message: > > { > "took" : 45, > "timed_out" : false, > "_shards" : { > "total" : 1, > "successful" : 0, > "failed" : 1, > "failures" : [ { > "index" : "12345", > "shard" : 1, > "status" : 500, > "reason" : > "RemoteTransportException[[Americop][inet[/10.0.0.5:9300]][search/phase/scan/scroll]]; > nested: QueryPhaseExecutionException[[12345][1]: > query[ConstantScore(cache(_type:CTable))],from[0],size[10000]: Query Failed > [Failed to execute main query]]; nested: NullPointerException; " > } ] > }, > "hits" : { > "total" : 1, > "max_score" : 0.0, > "hits" : [ ] > } > } > > > the same request working successfully via SearchRequestBuilder or REST. > > Am I missing something as it was running fine in version 0.90.5 ? > > To reproduce the same : > > curl -XPOST 'http://localhost:9200/12345' > > curl -XPUT 'http://localhost:9200/12345/PTable/row1?routing=12345' -d '{ > "user" : "dev-elasticsearch", > "post_date" : "2014-01-12", > "message" : "search with hasParentFilter in scroll not working" > }' > > Run the following code : > public static void main(String[] args) { > Client client = NodeBuilder.nodeBuilder().node().client(); > /* > PutMappingRequestBuilder pmrb = client.admin().indices() > .preparePutMapping("12345").setType("CTable"); > > > pmrb.setSource("{\"CTable\":{\"_parent\":{\"type\":\"PTable\"},\"_routing\":{\"required\":true}}}"); > pmrb.execute().actionGet(); > IndexRequestBuilder irb = new IndexRequestBuilder(client); > irb.setIndex("12345"); > irb.setType("CTable"); > irb.setId("childRow1"); > irb.setRouting("12345"); > irb.setParent("row1"); > Map<String, Object> data = new HashMap<String, Object>(); > data.put("col1", "val1"); > irb.setSource(data); > irb.execute().actionGet();*/ > > SearchRequestBuilder searchRequestBuilder = new > SearchRequestBuilder( > client); > searchRequestBuilder.setIndices("12345"); > searchRequestBuilder.setTypes("CTable"); > searchRequestBuilder.setRouting("12345"); > FilterBuilder postFilter = FilterBuilders.hasParentFilter("PTable", > FilterBuilders.termFilter("user", "elasticsearch")); > searchRequestBuilder.setPostFilter(postFilter); > searchRequestBuilder.addField("col1"); > searchRequestBuilder.setScroll("5m"); > searchRequestBuilder.setSearchType(SearchType.SCAN); > searchRequestBuilder.setSize(10000); > SearchResponse sr = searchRequestBuilder.execute().actionGet(); > > String scrollId = sr.getScrollId(); > SearchScrollRequestBuilder searchScrollRequestBuilder = new > SearchScrollRequestBuilder( > client); > searchScrollRequestBuilder.setScrollId(scrollId); > SearchResponse searchScrollResponse = searchScrollRequestBuilder > .execute().actionGet(); > ClearScrollRequestBuilder clearScrollRequestBuilder = new > ClearScrollRequestBuilder( > client); > clearScrollRequestBuilder.addScrollId(scrollId); > boolean isCleared = clearScrollRequestBuilder.execute().actionGet() > .isSucceeded(); > System.out.println(searchScrollResponse.getShardFailures()); > } > > Thanks > > -- > 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/1652d726-6e9e-4e91-a222-a06128182a8a%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > -- 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/CAGCwEM_A7N%3DjvUQANxOnPOZ%3Dy%3D5u%2BoQUMBhfU1NoUMvFETd9Qg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
