diff --git a/backend/channel/src/index.py b/backend/channel/src/index.py index 6d03ed92..64c9a88d 100644 --- a/backend/channel/src/index.py +++ b/backend/channel/src/index.py @@ -157,8 +157,18 @@ class YoutubeChannel(YouTubeItem): # add ingest pipeline processors = [] for field, value in self.json_data.items(): - line = {"set": {"field": "channel." + field, "value": value}} + if value is None: + line = { + "script": { + "lang": "painless", + "source": f"ctx['{field}'] = null;", + } + } + else: + line = {"set": {"field": "channel." + field, "value": value}} + processors.append(line) + data = {"description": self.youtube_id, "processors": processors} ingest_path = f"_ingest/pipeline/{self.youtube_id}" _, _ = ElasticWrap(ingest_path).put(data) diff --git a/frontend/src/components/ChannelList.tsx b/frontend/src/components/ChannelList.tsx index 90264a78..9bb42e50 100644 --- a/frontend/src/components/ChannelList.tsx +++ b/frontend/src/components/ChannelList.tsx @@ -49,7 +49,9 @@ const ChannelList = ({ channelList, refreshChannelList }: ChannelListProps) => {