where i’m getting this string error?help me with this

Here is my data, It’s based on a schema and I need to generate mapping to be indexed on ES. My background with ES is not much but I thought I got it until I tried it and failed and can’t find the right answer online..

error: BadRequestError(400, ‘mapper_parsing_exception’, ‘Expected map for property [fields] on field [type] but got a class java.lang.String’)

  from elasticsearch import Elasticsearch
  
  es = Elasticsearch("http://localhost:9200")

  mapping = {
 "mappings": {
    "properties": {
        "companyID": {"type": "keyword"},
        "client": {"type": "keyword"},
        "userID": {"type": "keyword"},
        "campaignID": {"type": "keyword"},
        "attachedCampaigns": {"type": "nested",
                              "properties": {
                                  "campaignID": {"type": "keyword"},
                                  "attachedAt": {"type": "date", 
                                                 "format": "yyyy-MM-dd HH:mm:ss"},
                                  "removedAt": {"type": "date",
                                                "format": "yyyy-MM-dd HH:mm:ss"},
                                  "attached": {"type": "boolean"},
                                  "status": {"type": "text"},
                                  "attachedBy": {"type": "keyword"},
                                  "userID": {"type": "keyword"}
                              }
                              },
        "jobSeekerID": {"type": "text"},
        "sharedArticleID": {"type": "keyword"},
        "status": {"type": "text"},
        "personnelStatus": {"type": "text"},
        "employmentStatus": {"type": "text"},
        "availability": {"type": "text"},
        "tagID": {"type": "keyword"},
        "active": {"type": "boolean"},
        "openApply": {"type": "boolean"},
        "resume": {
                   "properties": {
                       "profile": {
                           "properties": {
                               "fullName": {"type": "text"},
                               "firstName": {"type": "text"},
                               "middleName": {"type": "text"},
                               "lastName": {"type": "text"},
                               "nickName": {"type": "text"},
                               "nameSuffix": {"type": "text"},
                               "emails": {
                                          "properties": {
                                              "text": {"type": "text"},
                                              "email": {"type": "text"},
                                              "type": {"type": "text"},
                                              "preferred": {"type": "text"},
                                              "confidenceScore": {"type": "integer"},
                                              "valid": {"type": "boolean"},
                                              "verified": {"type": "boolean"},
                                              "subscribeStatus": {"type": "text"}
                                          }
                                          },
                               "phones": {
                                          "properties": {
                                              "text": {"type": "text"},
                                              "phoneNumberOnly": {"type": "text"},
                                              "internationalPhoneCode": {"type": "text"},
                                              "nationalPhoneCode": {"type": "text"},
                                              "country": {"type": "text"},
                                              "countryCode": {"type": "text"},
                                              "type": {"type": "text"},
                                              "preferred": {"type": "text"},
                                              "DNDStatus": {"type": "text"},
                                              "confidenceScore": {"type": "integer"},
                                              "valid": {"type": "boolean"},
                                              "verified": {"type": "boolean"},
                                              "subscribeStatus": {"type": "text"},
                                              "ontology": {"type": "boolean"}
                                          }
                                          },
                               "websites": {
                                   "properties": {
                                       "type": "keyword"
                                   }
                               },
                               "skypeID": {"type": "text"},
                               "locations": {
                                             "properties": {
                                                 "text": {"type": "text"},
                                                 "tier": {"type": "text"},
                                                 "address": {"type": "text"},
                                                 "addressType": {"type": "text"},
                                                 "area": {"type": "text"},
                                                 "city": {"type": "text"},
                                                 "district": {"type": "text"},
                                                 "state": {"type": "text"},
                                                 "stateCode": {"type": "text"},
                                                 "country": {"type": "text"},
                                                 "countryCode": {"type": "text"},
                                                 "postalCode": {"type": "text"},
                                                 "pin": {"type": "geo_point",
                                                         "properties": {
                                                             "lat": {"type": "text"},
                                                             "lon": {"type": "text"}
                                                         }
                                                         },
                                                 "cityCanonical": {"type": "text"},
                                                 "districtCanonical": {"type": "text"},
                                                 "stateCanonical": {"type": "text"},
                                                 "countryCanonical": {"type": "text"},
                                                 "foundInResume": {"type": "boolean"},
                                                 "confidenceScore": {"type": "integer"}
                                             }
                                             },
                               "gender": {
                                          "properties": {
                                              "text": {"type": "text"},
                                              "label": {"type": "text"},
                                              "found": {"type": "boolean"}
                                          }
                                          },
                               "ethnicity": {"type": "text"},
                               "veteranStatus": {"type": "text"},
                               "languagesKnown": {"type": "nested",
                                                  "properties": {
                                                      "type": "text"
                                                  }
                                                  },
                               "age": {
                                       "properties": {
                                           "text": {"type": "text"},
                                           "inYears": {"type": "integer"},
                                           "found": {"type": "boolean"},
                                           "confidenceScore": {"type": "integer"}
                                       }
                                       },
                               "dob": {
                                       "properties": {
                                           "text": {"type": "text"},
                                           "standard": {"type": "text"},
                                           "month": {"type": "text"},
                                           "date": {"type": "text"},
                                           "year": {"type": "text"},
                                           "confidenceScore": {"type": "integer"}
                                       }
                                       },
                               "nationality": {
                                               "properties": {
                                                   "text": {"type": "text"},
                                                   "label": {"type": "text"},
                                                   "nationalityCanonical": {"type": "text"},
                                                   "ethnicity": {"type": "text"},
                                                   "country": {"type": "text"},
                                                   "countryCode": {"type": "text"},
                                               }
                                               },
                               "maritalStatus": {"type": "text"},
                               "fatherName": {"type": "text"},
                               "motherName": {"type": "text"},
                               "spouseName": {"type": "text"},
                               "passport": {"type": "object",
                                            "properties": {
                                                "passportNumber": {"type": "text"},
                                                "country": {"type": "text"},
                                                "countryCode": {"type": "text"},
                                                "expiryDate": {
                                                    "properties": {
                                                        "text": {"type": "text"},
                                                        "standard": {"type": "text"},
                                                        "date": {"type": "text"},
                                                        "month": {"type": "text"},
                                                        "year": {"type": "text"}
                                                    }
                                                }
                                            }
                                            },
                               "profileImage": {
                                   "properties": {
                                       "content": {"type": "text"},
                                       "fileName": {"type": "text"}
                                   }
                               }
                           }
                       },
                       "professionalQualification": {
                           "properties": {
                               "certifications": {
                                   "properties": {
                                       "campus": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "canonical": {"type": "text"},
                                               "type": {"type": "text"},
                                               "confidenceScore": {"type": "integer"}
                                           }
                                       },
                                       "course": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "canonical": {"type": "keyword"},
                                               "type": {"type": "text"},
                                           }
                                       },
                                       "merit": {
                                           "properties": {
                                               "percentage": {"type": "double"},
                                               "GPA": {"type": "double"},
                                               "GPAOutOf": {"type": "double"},
                                           }
                                       },
                                       "currentStatus": {"type": "text"},
                                       "startDate": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "standard": {"type": "text"},
                                               "year": {"type": "text"},
                                               "month": {"type": "text"},
                                               "date": {"type": "text"},
                                           }
                                       },
                                       "endDate": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "standard": {"type": "text"},
                                               "year": {"type": "text"},
                                               "month": {"type": "text"},
                                               "date": {"type": "text"},
                                           }
                                       },
                                       "expiryDate": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "standard": {"type": "text"},
                                               "year": {"type": "text"},
                                               "month": {"type": "text"},
                                               "date": {"type": "text"},
                                           }
                                       },
                                       "duration": {
                                           "properties": {
                                               "text": {"type": "integer"},
                                               "inYears": {"type": "double"},
                                               "years": {"type": "integer"},
                                               "months": {"type": "integer"},
                                               "days": {"type": "integer"},
                                           }
                                       },
                                       "location": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "tier": {"type": "text"},
                                               "address": {"type": "text"},
                                               "area": {"type": "text"},
                                               "city": {"type": "text"},
                                               "district": {"type": "text"},
                                               "state": {"type": "text"},
                                               "stateCode": {"type": "text"},
                                               "country": {"type": "text"},
                                               "countryCode": {"type": "text"},
                                               "postalCode": {"type": "text"},
                                               "pin": {
                                                   "type": "geo_point",
                                                   "properties": {
                                                       "lat": {"type": "text"},
                                                       "lon": {"type": "text"}
                                                   }
                                               },
                                               "cityCanonical": {"type": "text"},
                                               "districtCanonical": {"type": "text"},
                                               "stateCanonical": {"type": "text"},
                                               "countryCanonical": {"type": "text"}
                                           }
                                       },
                                       "description": {"type": "text"}
                                   }
                               },
                               "academicProjects": {
                                   "properties": {
                                       "campus": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "canonical": {"type": "text"},
                                               "type": {"type": "text"},
                                               "confidenceScore": {"type": "integer"}
                                           }
                                       },
                                       "university": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "canonical": {"type": "text"},
                                               "type": {"type": "text"},
                                               "confidenceScore": {"type": "integer"}
                                           }
                                       },
                                       "projectTitle": {"type": "text"},
                                       "startDate": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "standard": {"type": "text"},
                                               "year": {"type": "text"},
                                               "month": {"type": "text"},
                                               "date": {"type": "text"},
                                           }
                                       },
                                       "endDate": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "standard": {"type": "text"},
                                               "year": {"type": "text"},
                                               "month": {"type": "text"},
                                               "date": {"type": "text"},
                                           }
                                       },
                                       "duration": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "inYears": {"type": "double"},
                                               "years": {"type": "integer"},
                                               "months": {"type": "integer"},
                                               "days": {"type": "integer"},
                                           }
                                       },
                                       "skills": {
                                           "properties": {"type": "keyword"}
                                       },
                                       "location": {
                                           "properties": {
                                               "text": {"type": "text"},
                                               "tier": {"type": "text"},
                                               "address": {"type": "text"},
                                               "area": {"type": "text"},
                                               "city": {"type": "text"},
                                               "district": {"type": "text"},
                                               "state": {"type": "text"},
                                               "stateCode": {"type": "text"},
                                               "country": {"type": "text"},
                                               "countryCode": {"type": "text"},
                                               "postalCode": {"type": "text"},
                                               "pin": {
                                                   "type": "geo_point",
                                                   "properties": {
                                                       "lat": {"type": "text"},
                                                       "lon": {"type": "text"}
                                                   }
                                               },
                                               "cityCanonical": {"type": "text"},
                                               "districtCanonical": {"type": "text"},
                                               "stateCanonical": {"type": "text"},

                                               "countryCanonical": {"type": "text"}
                                           }
                                       },
                                       "description": {"type": "text"}
                                   }
                               },
                               "skills": {
                                   "properties": {
                                       "text": {"type": "text"},
                                       "canonical": {
                                           "type": "text"
                                       },
                                       "canonicalDetails": {"type": "keyword"},
                                       "relations": {"type": "keyword"},
                                       "derived": {"type": "keyword"},
                                       "yearsOfExperience": {"type": "double"},
                                       "score": {"type": "double"},
                                       "confidenceScore": {"type": "integer"},
                                       "ontology": {"type": "boolean"},
                                       "importance": {"type": "text"}
                                   }
                               }
                           }
                       },
                       "professionalExperience": {
                           "properties": {
                               "company": {
                                   "properties": {
                                       "text": {"type": "text"},
                                       "redFlag": {"type": "boolean"},
                                       "canonical": {"type": "text"},
                                       "canonicalDetails": {"type": "keyword"},
                                       "confidenceScore": {"type": "integer"}
                                   }
                               },
                               "jobTitle": {
                                   "properties": {
                                       "text": {"type": "text"},
                                       "jobType": {"type": "text"},
                                       "jobCategory": {"type": "text"},
                                       "jobTitles": {
                                           "properties": {
                                               "jobTitle": {"type": "text"},
                                               "canonical": {
                                                   "properties": {
                                                       "type": "text"
                                                   }
                                               }
                                           }
                                       },
                                       "confidenceScore": {"type": "integer"},
                                   }
                               },
                               "skills": {
                                   "properties": {
                                       "text": {"type": "text"},
                                       "canonical": {"type": "text"},
                                       "canonicalDetails": {"type": "keyword"},
                                       "relations": {"type": "keyword"},
                                       "derived": {"type": "keyword"},
                                       "yearsOfExperience": {"type": "integer"},
                                       "score": {"type": "integer"},
                                       "confidenceScore": {"type": "integer"},
                                       "ontology": {"type": "boolean"},
                                       "importance": {"type": "text"}
                                   }
                               }
                           }
                       },
                   },
                   "genAISummary": {
                       "type": "text"
                   },
                   "createdAt": {
                       "type": "date",
                       "format": "yyyy-MM-dd HH:mm:ss"
                   },
                   "lastActiveAt": {
                       "type": "date",
                       "format": "yyyy-MM-dd HH:mm:ss
                   },
                   "verifiedAt": {
                       "type": "text"
                   },
                   "verified": {"type": "boolean"},
                   "avoidActivities": {
                       "type": "keyword"
                   },
                   "exportDetails": {
                       "properties": {
                           "status": {"type": "text"},
                           "message": {"type": "text"},
                           "lastExportedAt": {"type": "text"},
                           "exportID": {"type": "keyword"}
                       }
                   }
                   }
 }
 }
 }
 try:
 response = es.indices.create(index="my_index", body=mapping)
 print(response)
 except Exception as e:
 print(str(e))

New contributor

Mannem Saiteja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật