europeana-blacklight 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdb81441c4273124e40f92b211e8f8e4a867b6bd
4
- data.tar.gz: fa194c25a1b778b52b03cf982f4565aa1f559b3a
3
+ metadata.gz: 337f8c94916109a20fa3b1fbc5e47861f11bba11
4
+ data.tar.gz: 1d36e7d6abfb729595ca7d97ee1b82004b9598fd
5
5
  SHA512:
6
- metadata.gz: 9d0f4b83372d001682a62b692810648b19f29dc49ea5a015549f40d170fec5efcebb3d3f7bd4277dfa0d58e96386c9e8c1abaa641d77ff72cea6cbccff368677
7
- data.tar.gz: 1a082504cba1b0519a03751f37a89559a307f547e9292de4b5198c160fe0cf5008e49623d18b3abe1adeec8b6c74409f67f27a4c7d06b056236df4dc61261118
6
+ metadata.gz: b59c3fb0b34697ac2b270529f2c44720739d38c4504e144d75b3e7212dbeca8ac20648affc8ab0e779dc3866d36cdebf33d8ecebb9102c2a00def220590e2949
7
+ data.tar.gz: b998ec7c69ffd80bc166f49cbb2ad1bcf498647c8158443615c7972ab1cacfa3b95edeba2f62afd69be4f751796218fea098b1a3ebc007011c86db3a617e2f15
@@ -88,9 +88,7 @@ module Europeana
88
88
  def add_facet_qf_to_api(api_parameters)
89
89
  return unless blacklight_params[:f]
90
90
 
91
- salient_facets = blacklight_params[:f].select do |k, _v|
92
- !STANDALONE_FACETS.include?(k) && api_request_facet_fields.keys.include?(k)
93
- end
91
+ salient_facets = salient_facets_for_api_facet_qf
94
92
 
95
93
  salient_facets.each_pair do |facet_field, value_list|
96
94
  Array(value_list).reject(&:blank?).each do |value|
@@ -100,6 +98,12 @@ module Europeana
100
98
  end
101
99
  end
102
100
 
101
+ def salient_facets_for_api_facet_qf
102
+ blacklight_params[:f].select do |k, _v|
103
+ !STANDALONE_FACETS.include?(k) && api_request_facet_fields.keys.include?(k)
104
+ end
105
+ end
106
+
103
107
  def quote_facet_value(facet_field, value)
104
108
  return value if Europeana::API::Search::Fields::MEDIA.include?(facet_field)
105
109
  return value if value.include?('*')
@@ -142,9 +146,7 @@ module Europeana
142
146
  # @see http://labs.europeana.eu/api/search/#individual-facets
143
147
  # @see http://labs.europeana.eu/api/search/#offset-and-limit-of-facets
144
148
  def add_facetting_to_api(api_parameters)
145
- api_parameters[:facet] = api_request_facet_fields.keys.map do |field|
146
- Europeana::API::Search::Fields::MEDIA.include?(field) ? 'DEFAULT' : field
147
- end.uniq.join(',')
149
+ api_parameters[:facet] = api_request_facet_fields.keys.uniq.join(',')
148
150
 
149
151
  api_request_facet_fields.each do |field_name, facet|
150
152
  api_parameters[:"f.#{facet.field}.facet.limit"] = facet_limit_for(field_name) if facet_limit_for(field_name)
@@ -1,5 +1,5 @@
1
1
  module Europeana
2
2
  module Blacklight
3
- VERSION = '0.4.4'.freeze
3
+ VERSION = '0.4.5'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: europeana-blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Doe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blacklight