Skip to content

Commit

Permalink
remove unncessary logs
Browse files Browse the repository at this point in the history
  • Loading branch information
AitorAlgorta committed Sep 25, 2024
1 parent b4e2849 commit 736636b
Showing 1 changed file with 10 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,75 +26,63 @@ 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));
}
} else {
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");
}
}
Expand Down

0 comments on commit 736636b

Please sign in to comment.