Elasticsearch response alway return total hits is 0?

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

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

Response:

{
   "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

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:

GET /
1 Like

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

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