|
6 | 6 | const config = require('config')
|
7 | 7 |
|
8 | 8 | const topResources = {
|
| 9 | + skillprovider: { |
| 10 | + index: config.get('ES.DOCUMENTS.skillprovider.index'), |
| 11 | + type: config.get('ES.DOCUMENTS.skillprovider.type'), |
| 12 | + enrich: { |
| 13 | + policyName: 'skillprovider-policy', |
| 14 | + matchField: 'id', |
| 15 | + enrichFields: ['id', 'name', 'created', 'updated', 'createdBy', 'updatedBy'] |
| 16 | + }, |
| 17 | + pipeline: { |
| 18 | + id: 'skillprovider-pipeline', |
| 19 | + field: 'skillProviderId', |
| 20 | + targetField: 'skillprovider', |
| 21 | + maxMatches: '1' |
| 22 | + } |
| 23 | + }, |
| 24 | + |
| 25 | + role: { |
| 26 | + index: config.get('ES.DOCUMENTS.role.index'), |
| 27 | + type: config.get('ES.DOCUMENTS.role.type'), |
| 28 | + enrich: { |
| 29 | + policyName: 'role-policy', |
| 30 | + matchField: 'id', |
| 31 | + enrichFields: ['id', 'name', 'created', 'updated', 'createdBy', 'updatedBy'] |
| 32 | + } |
| 33 | + }, |
| 34 | + |
9 | 35 | achievementprovider: {
|
10 | 36 | index: config.get('ES.DOCUMENTS.achievementprovider.index'),
|
11 |
| - enrichPolicy: 'achievementprovider-policy', |
12 |
| - type: config.get('ES.DOCUMENTS.achievementprovider.type') |
13 |
| - }, |
14 |
| - attribute: { |
15 |
| - index: config.get('ES.DOCUMENTS.attribute.index'), |
16 |
| - enrichPolicy: 'attribute-policy', |
17 |
| - type: config.get('ES.DOCUMENTS.attribute.type') |
| 37 | + type: config.get('ES.DOCUMENTS.achievementprovider.type'), |
| 38 | + enrich: { |
| 39 | + policyName: 'achievementprovider-policy', |
| 40 | + matchField: 'id', |
| 41 | + enrichFields: ['id', 'name', 'created', 'updated', 'createdBy', 'updatedBy'] |
| 42 | + } |
18 | 43 | },
|
| 44 | + |
19 | 45 | attributegroup: {
|
20 | 46 | index: config.get('ES.DOCUMENTS.attributegroup.index'),
|
21 |
| - type: config.get('ES.DOCUMENTS.attributegroup.type') |
22 |
| - }, |
23 |
| - organization: { |
24 |
| - index: config.get('ES.DOCUMENTS.organization.index'), |
25 |
| - enrichPolicy: 'organization-policy', |
26 |
| - type: config.get('ES.DOCUMENTS.organization.type') |
27 |
| - }, |
28 |
| - role: { |
29 |
| - index: config.get('ES.DOCUMENTS.role.index'), |
30 |
| - enrichPolicy: 'role-policy', |
31 |
| - type: config.get('ES.DOCUMENTS.role.type') |
| 47 | + type: config.get('ES.DOCUMENTS.attributegroup.type'), |
| 48 | + enrich: { |
| 49 | + policyName: 'attributegroup-policy', |
| 50 | + matchField: 'id', |
| 51 | + enrichFields: ['id', 'name', 'organizationId', 'created', 'updated', 'createdBy', 'updatedBy'] |
| 52 | + }, |
| 53 | + pipeline: { |
| 54 | + id: 'attributegroup-pipeline', |
| 55 | + field: 'attributeGroupId', |
| 56 | + targetField: 'attributegroup', |
| 57 | + maxMatches: '1' |
| 58 | + } |
32 | 59 | },
|
| 60 | + |
33 | 61 | skill: {
|
34 | 62 | index: config.get('ES.DOCUMENTS.skill.index'),
|
35 |
| - enrichPolicy: 'skill-policy', |
36 |
| - type: config.get('ES.DOCUMENTS.skill.type') |
| 63 | + type: config.get('ES.DOCUMENTS.skill.type'), |
| 64 | + enrich: { |
| 65 | + policyName: 'skill-policy', |
| 66 | + matchField: 'id', |
| 67 | + enrichFields: ['id', 'skillProviderId', 'name', 'externalId', 'uri', 'created', 'updated', 'createdBy', 'updatedBy', 'skillprovider'] |
| 68 | + }, |
| 69 | + ingest: { |
| 70 | + pipeline: { |
| 71 | + id: 'skillprovider-pipeline' |
| 72 | + } |
| 73 | + } |
37 | 74 | },
|
38 |
| - skillprovider: { |
39 |
| - index: config.get('ES.DOCUMENTS.skillprovider.index'), |
40 |
| - type: config.get('ES.DOCUMENTS.skillprovider.type') |
| 75 | + |
| 76 | + attribute: { |
| 77 | + index: config.get('ES.DOCUMENTS.attribute.index'), |
| 78 | + type: config.get('ES.DOCUMENTS.attribute.type'), |
| 79 | + enrich: { |
| 80 | + policyName: 'attribute-policy', |
| 81 | + matchField: 'id', |
| 82 | + enrichFields: ['id', 'name', 'attributeGroupId', 'created', 'updated', 'createdBy', 'updatedBy', 'attributegroup'] |
| 83 | + }, |
| 84 | + ingest: { |
| 85 | + pipeline: { |
| 86 | + id: 'attributegroup-pipeline' |
| 87 | + } |
| 88 | + } |
41 | 89 | },
|
| 90 | + |
| 91 | + organization: { |
| 92 | + index: config.get('ES.DOCUMENTS.organization.index'), |
| 93 | + type: config.get('ES.DOCUMENTS.organization.type'), |
| 94 | + }, |
| 95 | + |
42 | 96 | user: {
|
43 | 97 | index: config.get('ES.DOCUMENTS.user.index'),
|
44 |
| - type: config.get('ES.DOCUMENTS.user.type') |
| 98 | + type: config.get('ES.DOCUMENTS.user.type'), |
| 99 | + pipeline: { |
| 100 | + id: 'user-pipeline', |
| 101 | + processors: [ |
| 102 | + { |
| 103 | + referenceField: config.get('ES.DOCUMENTS.achievement.userField'), |
| 104 | + enrichPolicyName: 'achievementprovider-policy', |
| 105 | + field: '_ingest._value.achievementsProviderId', |
| 106 | + targetField: '_ingest._value.achievementprovider', |
| 107 | + maxMatches: '1' |
| 108 | + }, |
| 109 | + { |
| 110 | + referenceField: config.get('ES.DOCUMENTS.externalprofile.userField'), |
| 111 | + enrichPolicyName: 'organization-policy', |
| 112 | + field: '_ingest._value.organizationId', |
| 113 | + targetField: '_ingest._value.organization', |
| 114 | + maxMatches: '1' |
| 115 | + }, |
| 116 | + { |
| 117 | + referenceField: config.get('ES.DOCUMENTS.userattribute.userField'), |
| 118 | + enrichPolicyName: 'attribute-policy', |
| 119 | + field: '_ingest._value.attributeId', |
| 120 | + targetField: '_ingest._value.attribute', |
| 121 | + maxMatches: '1' |
| 122 | + }, |
| 123 | + { |
| 124 | + referenceField: config.get('ES.DOCUMENTS.userrole.userField'), |
| 125 | + enrichPolicyName: 'role-policy', |
| 126 | + field: '_ingest._value.roleId', |
| 127 | + targetField: '_ingest._value.role', |
| 128 | + maxMatches: '1' |
| 129 | + }, |
| 130 | + { |
| 131 | + referenceField: config.get('ES.DOCUMENTS.userskill.userField'), |
| 132 | + enrichPolicyName: 'skill-policy', |
| 133 | + field: '_ingest._value.skillId', |
| 134 | + targetField: '_ingest._value.skill', |
| 135 | + maxMatches: '1' |
| 136 | + } |
| 137 | + ] |
| 138 | + } |
45 | 139 | }
|
46 | 140 | }
|
47 | 141 |
|
@@ -72,7 +166,12 @@ const userResources = {
|
72 | 166 | const organizationResources = {
|
73 | 167 | organizationskillprovider: {
|
74 | 168 | propertyName: config.get('ES.DOCUMENTS.organizationskillprovider.orgField'),
|
75 |
| - relateKey: 'skillProviderId' |
| 169 | + relateKey: 'skillProviderId', |
| 170 | + enrich: { |
| 171 | + policyName: 'organization-policy', |
| 172 | + matchField: 'id', |
| 173 | + enrichFields: ['id', 'name', 'created', 'updated', 'createdBy', 'updatedBy', 'skillProviders'] |
| 174 | + } |
76 | 175 | }
|
77 | 176 | }
|
78 | 177 |
|
|
0 commit comments