From 4c23cb6b30e87e5a2efcfbdbcc5c0d685ed85077 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 20 May 2014 21:49:15 -0700 Subject: [PATCH] Code cleaning --- lib/searchkick/index.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/searchkick/index.rb b/lib/searchkick/index.rb index 9ac1ea9..594c8b1 100644 --- a/lib/searchkick/index.rb +++ b/lib/searchkick/index.rb @@ -44,7 +44,7 @@ module Searchkick client.bulk( index: name, type: type, - body: batch.map{|r| data = search_data(r); {index: {_id: search_id(r), data: data}} } + body: batch.map{|r| {index: {_id: search_id(r), data: search_data(r)}} } ) end end @@ -81,13 +81,13 @@ module Searchkick def search_data(record) source = record.search_data + options = record.class.searchkick_options # stringify fields + # remove _id since search_id is used instead source = source.inject({}){|memo,(k,v)| memo[k.to_s] = v; memo}.except("_id") source["id"] ||= search_id(record) - options = record.class.searchkick_options - # conversions conversions_field = options[:conversions] if conversions_field and source[conversions_field] @@ -112,8 +112,6 @@ module Searchkick cast_big_decimal(source) - # p search_data - source.as_json end -- libgit2 0.21.0