From 036b364387dbcd39af750770f15be645b7d05c8b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 16 Oct 2017 00:16:37 +0200 Subject: [PATCH] Fixed issue #1538 - Unable to reindex tickets / elasticsearch error "MapperParsingException[failed to parse [article.ticket]]; nested: JsonParseException[Current token (START_OBJECT) not of boolean type". --- app/models/ticket/search_index.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/models/ticket/search_index.rb b/app/models/ticket/search_index.rb index 0113823fe..dbd0ecf8a 100644 --- a/app/models/ticket/search_index.rb +++ b/app/models/ticket/search_index.rb @@ -35,17 +35,16 @@ returns articles = Ticket::Article.where(ticket_id: id) attributes['article'] = [] articles.each do |article| - article_attributes = article.attributes - - # remove note needed attributes - ignore = %w(message_id_md5) - ignore.each do |attribute| - article_attributes.delete(attribute) - end # lookup attributes of ref. objects (normally name and note) article_attributes = article.search_index_attribute_lookup + # remove note needed attributes + ignore = %w(message_id_md5 ticket) + ignore.each do |attribute| + article_attributes.delete(attribute) + end + # index raw text body if article_attributes['content_type'] && article_attributes['content_type'] == 'text/html' && article_attributes['body'] article_attributes['body'] = article_attributes['body'].html2text