Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 07ea1ad

Browse files
Merge pull request #56 from topcoder-platform/enrich
Integrate enrich processor
2 parents 95eb66b + 310adc9 commit 07ea1ad

File tree

12 files changed

+818
-340
lines changed

12 files changed

+818
-340
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- node 12.x
66
- npm 6.x
77
- docker
8-
- elasticsearch 6.x
8+
- elasticsearch 7.7
99

1010
## Configuration
1111

@@ -36,8 +36,16 @@ Configuration for the application is at config/default.js and config/production.
3636
- UBAHN_DELETE_TOPIC: Kafka topic for delete message
3737
- UBAHN_AGGREGATE_TOPIC: Kafka topic that is used to combine all create, update and delete message(s)
3838
- ES.HOST: Elasticsearch host
39-
- ES.API_VERSION: Elasticsearch API version
4039
- ES.DOCUMENTS: Elasticsearch index, type and id mapping for resources.
40+
- ATTRIBUTE_GROUP_PIPELINE_ID: The pipeline id for enrichment with attribute group. Default is `attributegroup-pipeline`
41+
- SKILL_PROVIDER_PIPELINE_ID: The pipeline id for enrichment with skill provider. Default is `skillprovider-pipeline`
42+
- USER_PIPELINE_ID: The pipeline id for enrichment of user details. Default is `user-pipeline`
43+
- ATTRIBUTE_GROUP_ENRICH_POLICYNAME: The enrich policy for attribute group. Default is `attributegroup-policy`
44+
- SKILL_PROVIDER_ENRICH_POLICYNAME: The enrich policy for skill provider. Default is `skillprovider-policy`
45+
- ROLE_ENRICH_POLICYNAME: The enrich policy for role. Default is `role-policy`
46+
- ACHIEVEMENT_PROVIDER_ENRICH_POLICYNAME: The enrich policy for achievement provider. Default is `achievementprovider-policy`
47+
- SKILL_ENRICH_POLICYNAME: The enrich policy for skill. Default is `skill-policy`
48+
- ATTRIBUTE_ENRICH_POLICYNAME: The enrich policy for skill. Default is `attribute-policy`
4149

4250
For `ES.DOCUMENTS` configuration, you will find multiple other configurations below it. Each has default values that you can override using the environment variables
4351

config/default.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,41 +50,50 @@ module.exports = {
5050

5151
// ElasticSearch
5252
ES: {
53-
HOST: process.env.ES_HOST || 'localhost:9200',
54-
API_VERSION: process.env.ES_API_VERSION || '7.4',
53+
HOST: process.env.ES_HOST || 'http://localhost:9200',
5554
// es mapping: _index, _type, _id
5655
DOCUMENTS: {
5756
achievementprovider: {
5857
index: process.env.ACHIEVEMENT_PROVIDER_INDEX || 'achievement_provider',
59-
type: '_doc'
58+
type: '_doc',
59+
enrichPolicyName: process.env.ACHIEVEMENT_PROVIDER_ENRICH_POLICYNAME || 'achievementprovider-policy'
6060
},
6161
attribute: {
6262
index: process.env.ATTRIBUTE_INDEX || 'attribute',
63-
type: '_doc'
63+
type: '_doc',
64+
enrichPolicyName: process.env.ATTRIBUTE_ENRICH_POLICYNAME || 'attribute-policy'
6465
},
6566
attributegroup: {
6667
index: process.env.ATTRIBUTE_GROUP_INDEX || 'attribute_group',
67-
type: '_doc'
68+
type: '_doc',
69+
pipelineId: process.env.ATTRIBUTE_GROUP_PIPELINE_ID || 'attributegroup-pipeline',
70+
enrichPolicyName: process.env.ATTRIBUTE_GROUP_ENRICH_POLICYNAME || 'attributegroup-policy'
6871
},
6972
organization: {
7073
index: process.env.ORGANIZATION_INDEX || 'organization',
71-
type: '_doc'
74+
type: '_doc',
75+
enrichPolicyName: process.env.ORGANIZATION_ENRICH_POLICYNAME || 'organization-policy'
7276
},
7377
role: {
7478
index: process.env.ROLE_INDEX || 'role',
75-
type: '_doc'
79+
type: '_doc',
80+
enrichPolicyName: process.env.ROLE_ENRICH_POLICYNAME || 'role-policy'
7681
},
7782
skill: {
7883
index: process.env.SKILL_INDEX || 'skill',
79-
type: '_doc'
84+
type: '_doc',
85+
enrichPolicyName: process.env.SKILL_ENRICH_POLICYNAME || 'skill-policy'
8086
},
8187
skillprovider: {
8288
index: process.env.SKILL_PROVIDER_INDEX || 'skill_provider',
83-
type: '_doc'
89+
type: '_doc',
90+
pipelineId: process.env.SKILL_PROVIDER_PIPELINE_ID || 'skillprovider-pipeline',
91+
enrichPolicyName: process.env.SKILL_PROVIDER_ENRICH_POLICYNAME || 'skillprovider-policy'
8492
},
8593
user: {
8694
index: process.env.USER_INDEX || 'user',
87-
type: '_doc'
95+
type: '_doc',
96+
pipelineId: process.env.USER_PIPELINE_ID || 'user-pipeline'
8897
},
8998
// sub resources under user
9099
achievement: {

0 commit comments

Comments
 (0)