From 736636b039a4f008f29cc3054dbc7b01148f5d87 Mon Sep 17 00:00:00 2001 From: Aitor Algorta Date: Wed, 25 Sep 2024 11:09:06 +0200 Subject: [PATCH] remove unncessary logs --- .../communication/lucene/DocumentMapper.java | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/backend/components/communication/src/main/java/co/airy/core/communication/lucene/DocumentMapper.java b/backend/components/communication/src/main/java/co/airy/core/communication/lucene/DocumentMapper.java index 5856a1d86..cb0ccc3a4 100644 --- a/backend/components/communication/src/main/java/co/airy/core/communication/lucene/DocumentMapper.java +++ b/backend/components/communication/src/main/java/co/airy/core/communication/lucene/DocumentMapper.java @@ -26,58 +26,50 @@ public Document fromConversationIndex(ConversationIndex conversation) { final Document document = new Document(); if (conversation.getId() != null) { - log.error("1"); document.add(new StringField("id", conversation.getId(), Field.Store.YES)); } else { log.error("conversation.getId() is null"); } if (conversation.getChannelId() != null) { - log.error("2"); document.add(new StringField("channel_id", conversation.getChannelId(), Field.Store.YES)); } else { log.error("conversation.getChannelId() is null"); } - if (conversation.getDisplayName() != null) { - log.error("3"); + if (conversation.getDisplayName() != null) { document.add(new TextField("display_name", conversation.getDisplayName(), Field.Store.YES)); } else { log.error("conversation.getDisplayName() is null"); } - if (conversation.getSource() != null) { - log.error("4"); + if (conversation.getSource() != null) { document.add(new StringField("source", conversation.getSource(), Field.Store.YES)); } else { log.error("conversation.getSource() is null"); } - if (conversation.getCreatedAt() != null) { - log.error("5"); + if (conversation.getCreatedAt() != null) { document.add(new LongPoint("created_at", conversation.getCreatedAt())); document.add(new StoredField("created_at", conversation.getCreatedAt())); } else { log.error("conversation.getCreatedAt() is null"); } - if (conversation.getUnreadMessageCount() != null) { - log.error("6"); + if (conversation.getUnreadMessageCount() != null) { document.add(new IntPoint("unread_count", conversation.getUnreadMessageCount())); document.add(new StoredField("unread_count", conversation.getUnreadMessageCount())); } else { log.error("conversation.getUnreadMessageCount() is null"); } - if (conversation.getLastMessageAt() != null) { - log.error("7"); + if (conversation.getLastMessageAt() != null) { document.add(new NumericDocValuesField("last_message_at", conversation.getLastMessageAt())); } else { log.error("conversation.getLastMessageAt() is null"); } - if (conversation.getTagIds() != null) { - log.error("8"); + if (conversation.getTagIds() != null) { for (String tagId : conversation.getTagIds()) { document.add(new TextField("tag_ids", tagId, Field.Store.YES)); } @@ -85,16 +77,12 @@ public Document fromConversationIndex(ConversationIndex conversation) { log.error("conversation.getTagIds() is null"); } - if (conversation.getMetadata() != null) { - log.error("9"); - for (MetadataNode node : conversation.getMetadata()) { - log.error("10"); + if (conversation.getMetadata() != null) { + for (MetadataNode node : conversation.getMetadata()) { final String key = String.format("metadata.%s", node.getKey()); - if (node.getValue() != null) { - log.error("11"); + if (node.getValue() != null) { document.add(new TextField(key, node.getValue(), Field.Store.NO)); - } else { - log.error("12"); + } else { log.error("Metadata value for key \" + node.getKey() + \" is null"); } }