# Elasticsearch response alway return total hits is 0?

**URL:** https://discuss.elastic.co/t/elasticsearch-response-alway-return-total-hits-is-0/269603
**Category:** Elasticsearch
**Created:** [April 8, 2021, 2:04pm UTC](https://discuss.elastic.co/t/elasticsearch-response-alway-return-total-hits-is-0/269603 "2021-04-08T14:04:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![NinhNM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ninhnm/32/86797_2.png) [@NinhNM](https://discuss.elastic.co/u/NinhNM)
#### Post date: [April 8, 2021, 2:04pm UTC](https://discuss.elastic.co/t/elasticsearch-response-alway-return-total-hits-is-0/269603/1 "2021-04-08T14:04:55Z")

</div>

I have use ELS 7.11. I make single query with multiple conditions  
Query:

```auto
  {
  "bool" : {
    "filter" : [
      {
        "term" : {
          "loa" : {
            "value" : "2",
            "boost" : 1.0
          }
        }
      },
      {
        "term" : {
          "gender" : {
            "value" : "1",
            "boost" : 1.0
          }
        }
      }
    ],
    "adjust_pure_negative" : true,
    "boost" : 1.0
  }
}

```

Response:

```auto
{
   "took":16,
   "timed_out":false,
   "_shards":{
      "total":1,
      "successful":1,
      "skipped":0,
      "failed":0
   },
   "hits":{
      "total":0,
      "max_score":0.0,
      "hits":[
         {
            "_index":"vnconnect_umuser",
            "_type":"vnconnect_umuser",
            "_id":"9354",
            "_score":0.0,
            "_source":{
               "src":"Xác thực bởi quản trị viên",
               "fullname":"Đào Xuân Sỹ",
               "mobile":"0945631506",
               "year":"1971",
               "mail":"daoxuansy@quangtri.gov.vn",
               "active_auth":null,
               "@version":"1",
               "um_id":9354,
               "citizen_id":null,
               "note":"lý do ",
               "@timestamp":"2021-04-07T02:14:46.539Z",
               "data_sources":"1",
               "gender":"1",
               "um_user_name":"76287372-efad-47cc-9922-ed5551985d34",
               "dob":"19710505",
               "birth_place":"Xã Sảng Tủng, Huyện Đồng Văn, Tỉnh Hà Giang",
               "active":"1",
               "identity":"197003872",
               "time_removed":null,
               "provider":"Vinaphone",
               "loa":"Mức 2"
            }
         },
         {
            "_index":"vnconnect_umuser",
            "_type":"vnconnect_umuser",
            "_id":"2645",
            "_score":0.0,
            "_source":{
               "src":"Dữ liệu tạo theo công văn",
               "fullname":"fdsafsd",
               "mobile":"03297438927",
               "year":"2020",
               "mail":null,
               "active_auth":null,
               "@version":"1",
               "um_id":2645,
               "citizen_id":null,
               "note":"fdsads",
               "@timestamp":"2021-04-07T02:14:46.564Z",
               "data_sources":"2",
               "gender":"1",
               "um_user_name":"9241e762-4fdf-465a-a031-cf64e8f4b557",
               "dob":"20200303",
               "birth_place":"Xã Xuân Trường,Huyện Bảo Lạc,Tỉnh Cao Bằng",
               "active":"1",
               "identity":"043297438",
               "time_removed":null,
               "provider":null,
               "loa":"2"
            }
         },

```

I want use total make pagination for website, response have data but hits:total always is 0

---

<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: [April 8, 2021, 2:17pm UTC](https://discuss.elastic.co/t/elasticsearch-response-alway-return-total-hits-is-0/269603/2 "2021-04-08T14:17:09Z")

</div>

Sorry but are you sure that you are using elasticsearch 7.11? The response object does not look like a 7.x response object...

What is the output of:

```auto
GET /

```

---

<div class="post-metadata">

### Author: ![NinhNM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ninhnm/32/86797_2.png) [@NinhNM](https://discuss.elastic.co/u/NinhNM)
#### Post date: [April 9, 2021, 2:00am UTC](https://discuss.elastic.co/t/elasticsearch-response-alway-return-total-hits-is-0/269603/3 "2021-04-09T02:00:22Z")

</div>

thanks you @dadoonet, i change new version in setting and resolve issue

---

<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: [May 7, 2021, 2:00am UTC](https://discuss.elastic.co/t/elasticsearch-response-alway-return-total-hits-is-0/269603/4 "2021-05-07T02:00:56Z")

</div>

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