Skip to content

Commit 41cfc9c

Browse files
authored
Merge pull request #63 from ikanashov/MG-3541
MG-3541: refactor: use id == urn for elasticsearch
2 parents 0c4ae71 + a31e037 commit 41cfc9c

File tree

6 files changed

+582
-385
lines changed

6 files changed

+582
-385
lines changed

data-detective-etl/dags/dags/dd_load_elastic_search/code/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
def _apply_rank(entity: pd.Series, rank_groups: list[dict[str, str]]) -> Union[str, list[str], float, int]:
1616
"""Apply search rank for every entity
17-
If more then one rank for entity choose max rank
17+
If more than one rank for entity choose max rank
1818
If rank not found set rank 1
1919
:param entity: dds.entity
2020
:param rank_groups: search rank group for entity
2121
:return: search rank
2222
"""
2323
ranks = []
2424

25-
entity_name = entity['id']
25+
entity_name = entity['entity_name']
2626
entity_type = entity['entity_type']
2727

2828
for rank_group in rank_groups:

data-detective-etl/dags/dags/dd_load_elastic_search/code/dump_search_data.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
select urn
2-
, lower(entity_name) as id
2+
, urn as id
3+
, lower(entity_name) as entity_name
34
, json_system->'type_for_search' as type_for_search
45
, json_system->'system_for_search' as system_for_search
56
, entity_type

0 commit comments

Comments
 (0)