diff options
author | Edwin Lawrance <Edwin.Lawrance@amdocs.com> | 2018-09-13 11:19:43 +0100 |
---|---|---|
committer | Lawrance, Edwin (el525a) <Edwin.Lawrance@amdocs.com> | 2018-09-14 11:01:13 +0100 |
commit | 82658daad05f982a8358581623f44a1554238a48 (patch) | |
tree | 6e6c757da7aa02c1a5745549791bf313a4f7a5c7 /src/test/resources/json | |
parent | fe84ae3b8d01ac2634d389f6b9d579319ea39f7a (diff) |
Fix to not remove whitespaces in the payload to ES
Change-Id: I3547e79ff27220a49539d9cfdf48ac534f155f10
Issue-ID: AAI-1596
Signed-off-by: Edwin Lawrance <Edwin.Lawrance@amdocs.com>
Diffstat (limited to 'src/test/resources/json')
-rw-r--r-- | src/test/resources/json/es-payload-translation.json | 22 | ||||
-rw-r--r-- | src/test/resources/json/index-mapping.json | 28 |
2 files changed, 35 insertions, 15 deletions
diff --git a/src/test/resources/json/es-payload-translation.json b/src/test/resources/json/es-payload-translation.json index e5290b0..58ed8f6 100644 --- a/src/test/resources/json/es-payload-translation.json +++ b/src/test/resources/json/es-payload-translation.json @@ -1,24 +1,16 @@ { - "attr-translations": [ - { - "from": "\"data-type\":\"string\"", - "to": "\"data-type\":\"text\",\"fielddata\":true" - }, + "attr-translations": [ { - "from": "\"type\":\"string\",\"index\":\"analyzed\"", - "to": "\"type\":\"text\",\"index\":\"true\",\"fielddata\":true" + "query": "$..[?(@.type=='string' && @.index=='analyzed')]", + "update": {"type": "text", "index": true, "fielddata": true} }, { - "from": "\"type\":\"string\",\"index\":\"not_analyzed\"", - "to": "\"type\":\"keyword\",\"index\":\"true\"" + "query": "$..[?(@.type=='string' && @.index=='not_analyzed')]", + "update": {"type": "keyword", "index": true} }, { - "from": "\"type\":\"string\"", - "to": "\"type\":\"text\",\"fielddata\":true" - }, - { - "from": "searchable", - "to": "index" + "query": "$..[?(@.type=='string' && !@.index)]", + "update": {"type": "text", "fielddata": true} } ] }
\ No newline at end of file diff --git a/src/test/resources/json/index-mapping.json b/src/test/resources/json/index-mapping.json new file mode 100644 index 0000000..e447092 --- /dev/null +++ b/src/test/resources/json/index-mapping.json @@ -0,0 +1,28 @@ +{ + "fields": [ + {"name": "validationId", "type": "string", "searchable": false}, + {"name": "validationTimestamp1", "type": "date", "format": "MMM d y HH:m:s||dd-MM-yyyy HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss.SSSZZ||MM\/dd\/yyyy||yyyyMMdd'T'HHmmssZ"}, + {"name": "entityId", "type": "nested"}, + {"name": "entityType", "type": "string", "index": "analyzed"}, + {"name": "entityLink", "type": "string"}, + + {"name": "resourceVersion", "type": "string", "index": "not_analyzed"}, + {"name": "violations", "type": "nested", "sub-fields": [ + {"name": "violationId", "type": "string"}, + {"name": "violationTimestamp", "type": "date", "format": "MMM d y HH:m:s||dd-MM-yyyy HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss.SSSZZ||MM\/dd\/yyyy||yyyyMMdd'T'HHmmssZ"}, + {"name": "modelName", "type": "string"}, + {"name": "category", "type": "string"}, + {"name": "severity", "type": "string"}, + {"name": "violationType", "type": "string"}, + {"name": "validationRule", "type": "string"}, + {"name": "violationDetails", "type": "nested", "sub-fields": [ + {"name": "entityId", "type": "nested"}, + {"name": "entityType", "type": "string"}, + {"name": "modelName", "type": "string"}, + {"name": "MISSING_REL", "type": "string"} + ]}, + {"name": "errorMessage", "type": "string", "errMsg": "Sample error message for whitespace check"} + ]} + ] + +} |