diff --git a/lib/indexer/bulk_payload_generator.rb b/lib/indexer/bulk_payload_generator.rb index a93db5cb7..4565b80b3 100644 --- a/lib/indexer/bulk_payload_generator.rb +++ b/lib/indexer/bulk_payload_generator.rb @@ -45,7 +45,7 @@ def index_action(doc_hash) { "index" => { "_type" => "generic-document", - "_id" => (doc_hash["_id"] || doc_hash["link"]), + "_id" => doc_hash["_id"] || doc_hash["link"], }, } end diff --git a/lib/parameter_parser/aggregate_parameter_parser.rb b/lib/parameter_parser/aggregate_parameter_parser.rb index 87a3bc59d..76afbca89 100644 --- a/lib/parameter_parser/aggregate_parameter_parser.rb +++ b/lib/parameter_parser/aggregate_parameter_parser.rb @@ -96,7 +96,7 @@ def order ALLOWED_AGGREGATE_SORT_OPTIONS.include?(option) end - invalid_orders.each do |option, _| + invalid_orders.each do |(option, _)| @errors << %("#{option}" is not a valid sort option#{aggregate_description}) end diff --git a/lib/parameter_parser/aggregates_parameter_parser.rb b/lib/parameter_parser/aggregates_parameter_parser.rb index 7710254a9..7731703ee 100644 --- a/lib/parameter_parser/aggregates_parameter_parser.rb +++ b/lib/parameter_parser/aggregates_parameter_parser.rb @@ -11,7 +11,7 @@ def initialize(params, allowed_return_fields) end def call - @params.each do |key, _values| + @params.each_key do |key| # to ensure backwards compatibility we will support both facet_* and aggregate_* style naming # - all aggregations in the request must use the same naming format matches = key.match(/\A(facet|aggregate)_(.*)\Z/) diff --git a/lib/schema/index_schema.rb b/lib/schema/index_schema.rb index 4a6f0e5b3..2efb3df22 100644 --- a/lib/schema/index_schema.rb +++ b/lib/schema/index_schema.rb @@ -13,7 +13,7 @@ def es_mappings properties = { "document_type" => @document_type_field, } - @elasticsearch_types.each do |_key, value| + @elasticsearch_types.each_value do |value| properties = properties.merge(value.es_config) end { diff --git a/spec/unit/result_set_presenter_spec.rb b/spec/unit/result_set_presenter_spec.rb index 4bfb4ad83..01324c126 100644 --- a/spec/unit/result_set_presenter_spec.rb +++ b/spec/unit/result_set_presenter_spec.rb @@ -122,7 +122,7 @@ def search_presenter(options) end it "have only the fields returned from search engine" do - @output[:results].zip(sample_docs).each do |result, _doc| + @output[:results].zip(sample_docs).each do |(result, _)| doc_fields = result.keys - %i[_type _id] returned_fields = result.keys - %i[esscore _type _id] expect(doc_fields).to eq(returned_fields) @@ -198,7 +198,7 @@ def search_presenter(options) end it "have only the fields returned from search engine" do - @output[:results].zip(sample_docs).each do |result, _doc| + @output[:results].zip(sample_docs).each do |(result, _)| doc_fields = result.keys - %i[_type _id] returned_fields = result.keys - %i[esscore _type _id] expect(doc_fields).to eq(returned_fields)