mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-02 22:28:24 +00:00
Event logging, add pluggable interfaces and AuditLog, ElasticSearch implementations
This commit is contained in:
parent
6950c3d7df
commit
d8e31c11a5
@ -61,16 +61,21 @@ public class ElasticSearchEventHandler implements EventHandler {
|
||||
Table instance = (Table) entity;
|
||||
Map<String, Object> jsonMap = new HashMap<>();
|
||||
jsonMap.put("description", instance.getDescription());
|
||||
Set<String> tags = new HashSet<String>();
|
||||
Set<String> tags = new HashSet<>();
|
||||
List<String> columnDescriptions = new ArrayList<>();
|
||||
instance.getTags().forEach(tag -> tags.add(tag.getTagFQN()));
|
||||
for(Column column: instance.getColumns()) {
|
||||
column.getTags().forEach(tag -> tags.add(tag.getTagFQN()));
|
||||
columnDescriptions.add(column.getDescription());
|
||||
}
|
||||
if (!tags.isEmpty()) {
|
||||
List<String> tagsList = new ArrayList<>();
|
||||
tagsList.addAll(tags);
|
||||
jsonMap.put("tags", tagsList);
|
||||
}
|
||||
if (!columnDescriptions.isEmpty()) {
|
||||
jsonMap.put("column_descriptions", columnDescriptions);
|
||||
}
|
||||
UpdateRequest updateRequest = new UpdateRequest("table_search_index", instance.getId().toString());
|
||||
updateRequest.doc(jsonMap);
|
||||
client.updateAsync(updateRequest, RequestOptions.DEFAULT, listener);
|
||||
|
Loading…
x
Reference in New Issue
Block a user