Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
#305: the channelId field is now only set in the response if the chan…
Browse files Browse the repository at this point in the history
…nelId is known by Smarti
  • Loading branch information
westei committed Apr 2, 2019
1 parent dbb7b88 commit 3d279f7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ private ConversationSectionResult toConversationSectionResult(ComponentConfigura
conversationResult.setReplySuggestion(String.valueOf(solrDocument.getFirstValue(FIELD_MESSAGE)));

conversationResult.setConversationId(String.valueOf(solrDocument.getFieldValue(FIELD_CONVERSATION_ID)));
conversationResult.setChannelId(String.valueOf(solrDocument.getFirstValue(ConversationIndexConfiguration.getMetaField("channel_id"))));

Object channelIdVal = solrDocument.getFirstValue(ConversationIndexConfiguration.getMetaField("channel_id"));
if(channelIdVal != null) {
conversationResult.setChannelId(String.valueOf(channelIdVal));
}

conversationResult.setVotes(Integer.parseInt(String.valueOf(solrDocument.getFieldValue(FIELD_VOTE))));

Expand Down

0 comments on commit 3d279f7

Please sign in to comment.