Skip to content

Commit

Permalink
Merge pull request #33485 from dimagi/ap/es/es5-compatible-mappings
Browse files Browse the repository at this point in the history
ES-5 compatible mappings and related changes
  • Loading branch information
AmitPhulera authored Sep 20, 2023
2 parents 9a08d95 + d4aa114 commit 307e3c5
Show file tree
Hide file tree
Showing 15 changed files with 432 additions and 491 deletions.
303 changes: 128 additions & 175 deletions corehq/apps/es/mappings/app_mapping.py

Large diffs are not rendered by default.

85 changes: 35 additions & 50 deletions corehq/apps/es/mappings/case_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,30 @@
"type": "nested",
"properties": {
"action_type": {
"type": "string"
"type": "text"
},
"date": {
"format": DATE_FORMATS_STRING,
"type": "date"
},
"doc_type": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"indices": {
"dynamic": False,
"type": "object",
"properties": {
"doc_type": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"identifier": {
"type": "string"
"type": "text"
},
"referenced_id": {
"type": "string"
"type": "text"
},
"referenced_type": {
"type": "string"
"type": "text"
}
}
},
Expand All @@ -50,32 +48,30 @@
"type": "date"
},
"sync_log_id": {
"type": "string"
"type": "text"
},
"user_id": {
"type": "string"
"type": "text"
},
"xform_id": {
"type": "string"
"type": "text"
},
"xform_name": {
"type": "string"
"type": "text"
},
"xform_xmlns": {
"type": "string"
"type": "text"
}
}
},
"backend_id": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"closed": {
"type": "boolean"
},
"closed_by": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"closed_on": {
"format": DATE_FORMATS_STRING,
Expand All @@ -90,50 +86,45 @@
"type": "date"
},
"contact_phone_number": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"doc_type": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"domain": {
"fields": {
"exact": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
}
},
"type": "string"
"type": "text"
},
"export_tag": {
"type": "string"
"type": "text"
},
"external_id": {
"fields": {
"exact": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
}
},
"type": "string"
"type": "text"
},
"indices": {
"dynamic": False,
"type": "object",
"properties": {
"doc_type": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"identifier": {
"type": "string"
"type": "text"
},
"referenced_id": {
"type": "string"
"type": "text"
},
"referenced_type": {
"type": "string"
"type": "text"
}
}
},
Expand All @@ -145,7 +136,7 @@
"type": "date"
},
"location_id": {
"type": "string"
"type": "text"
},
"modified_on": {
"format": DATE_FORMATS_STRING,
Expand All @@ -154,28 +145,24 @@
"name": {
"fields": {
"exact": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
}
},
"type": "string"
"type": "text"
},
"opened_by": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"opened_on": {
"format": DATE_FORMATS_STRING,
"type": "date"
},
"owner_id": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"owner_type": {
"index": "not_analyzed",
"null_value": NULL_VALUE,
"type": "string"
"type": "keyword"
},
"referrals": {
"enabled": False,
Expand All @@ -188,21 +175,19 @@
"type": {
"fields": {
"exact": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
}
},
"type": "string"
"type": "text"
},
"user_id": {
"type": "string"
"type": "text"
},
"version": {
"type": "string"
"type": "text"
},
"xform_ids": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
Tombstone.PROPERTY_NAME: {
"type": "boolean"
Expand Down
64 changes: 23 additions & 41 deletions corehq/apps/es/mappings/case_search_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
"key": {
"fields": {
"exact": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
}
},
"type": "string"
"type": "text"
},
"value": {
"fields": {
Expand All @@ -39,21 +38,19 @@
},
"exact": {
"ignore_above": 8191,
"index": "not_analyzed",
"null_value": "",
"type": "string"
"type": "keyword"
},
"numeric": {
"ignore_malformed": True,
"type": "double"
},
"phonetic": {
"analyzer": "phonetic",
"type": "string"
"type": "text"
}
},
"null_value": "",
"type": "string"
"type": "text"
},
"geopoint_value": {
"type": "geo_point"
Expand All @@ -64,59 +61,49 @@
"type": "boolean"
},
"closed_by": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"closed_on": {
"format": DATE_FORMATS_STRING,
"type": "date"
},
"doc_type": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"domain": {
"fields": {
"exact": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
}
},
"type": "string"
"type": "text"
},
"external_id": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"indices": {
"dynamic": False,
"type": "nested",
"properties": {
"doc_type": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"identifier": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"referenced_id": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"referenced_type": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"relationship": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
}
}
},
"location_id": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"modified_on": {
"format": DATE_FORMATS_STRING,
Expand All @@ -125,23 +112,20 @@
"name": {
"fields": {
"exact": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
}
},
"type": "string"
"type": "text"
},
"opened_by": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"opened_on": {
"format": DATE_FORMATS_STRING,
"type": "date"
},
"owner_id": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
"server_modified_on": {
"format": DATE_FORMATS_STRING,
Expand All @@ -150,15 +134,13 @@
"type": {
"fields": {
"exact": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
}
},
"type": "string"
"type": "text"
},
"user_id": {
"index": "not_analyzed",
"type": "string"
"type": "keyword"
},
Tombstone.PROPERTY_NAME: {
"type": "boolean"
Expand Down
Loading

0 comments on commit 307e3c5

Please sign in to comment.