# Java high level client 7.10 shard successful 0 when took \> 1000

**URL:** <https://discuss.elastic.co/t/java-high-level-client-7-10-shard-successful-0-when-took-1000/265291>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [February 24, 2021, 8:50am UTC](https://discuss.elastic.co/t/java-high-level-client-7-10-shard-successful-0-when-took-1000/265291 "2021-02-24T08:50:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZorroYue](https://avatars.discourse-cdn.com/v4/letter/z/74df32/32.png) [@ZorroYue](https://discuss.elastic.co/u/ZorroYue)\
**Post date:** [February 24, 2021, 8:50am UTC](https://discuss.elastic.co/t/java-high-level-client-7-10-shard-successful-0-when-took-1000/265291/1 "2021-02-24T08:50:38Z")

</div>

Hi  
I'm using java high level client to execute aggregation。 when the took in response gt 1000,it give a wrong result like below( it always ok when i do it in kibana):

```auto
{
  "took": 1002,
  "timed_out": false,
  "terminated_early": false,
  "num_reduce_phases": 0,
  "_shards": {
    "total": 20,
    "successful": 0,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 0,
      "relation": "gte"
    },
    "max_score": null,
    "hits": 
  }
}

```

and when i redo the search,it may success or not .it success like below(it's took less than 1000)

```auto
{
  "took" : 231,
  "timed_out" : false,
  "_shards" : {
    "total" : 20,
    "successful" : 20,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 10000,
      "relation" : "gte"
    },
    "max_score" : null,
    "hits" : []
  },
  "aggregations" : {
    "term0" : {
      "doc_count" : 8526098,
      "countCOUNT_DISTINCTdid" : {
        "value" : 3929368
      }
    }
  }
}

```

It looks like failfast.Why is this and how to solve it.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 25, 2021, 9:12am UTC](https://discuss.elastic.co/t/java-high-level-client-7-10-shard-successful-0-when-took-1000/265291/2 "2021-02-25T09:12:40Z")

</div>

Could you share the exact code you are using?

How do you build the client is mainly what I'd like to see.

What kind of cluster is running behind it? How many nodes? Where is this running?

---

<div class="post-metadata">

**Author:** ![ZorroYue](https://avatars.discourse-cdn.com/v4/letter/z/74df32/32.png) [@ZorroYue](https://discuss.elastic.co/u/ZorroYue)\
**Post date:** [February 26, 2021, 9:32am UTC](https://discuss.elastic.co/t/java-high-level-client-7-10-shard-successful-0-when-took-1000/265291/4 "2021-02-26T09:32:48Z")

</div>

I find it because i'm using async search but forgot check if it is finished。  
if it is still running ,it give a incompletion result as above.  
it looks like failfast because wait\_for\_completion\_timeout's default value is 1s.[Submit async search API](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/async-search.html#submit-async-search)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 26, 2021, 9:33am UTC](https://discuss.elastic.co/t/java-high-level-client-7-10-shard-successful-0-when-took-1000/265291/5 "2021-03-26T09:33:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
