blacklight-spotlight 3.5.0.2 → 3.5.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b37ca44843ce17defff551d04be7ad02dec03229756548a7f42dbda6d7608ed
4
- data.tar.gz: d240e8284f7030833fd81256d232c37f3ee178c8b329823007a1de6d44e6e7ca
3
+ metadata.gz: 6f2b5e2ecd48de319a43b16c29e60ab1fcff2936525f54241c8a338eb94f73f3
4
+ data.tar.gz: 673c1ecde408e6406c34db51e29f00c56364ba999b584e9f68ad4c3849fc86cc
5
5
  SHA512:
6
- metadata.gz: 6ab409d1cb4743910da14cc580d2048fe18a798edcbaa5b5dcbf93c67b1a7c9a6e40a9647a44262d369e13830cf7e3a0419278c18a3de58bbb70a2df93933716
7
- data.tar.gz: 900d4dec2ff3596e0f9ee37f66b118419317eb8c1a2931827a1ed3ebb117a3a6324e9358bb660180f94c63427db39520b3663e8cb167afc2db4d54bd01ef86a5
6
+ metadata.gz: f682bd13aa9a3584da448b68da13b45de241d04c42acfa7e45104013c4d0ae666e6927fbdddb9b85364ccaf85634b7d0c35b3f2f86c3096f1c293ebf2821a6bb
7
+ data.tar.gz: eccb8a8e6fe2caea9986018c2c0524159d7d7862c27d57a0419fc9208f34c0d7c3779e311601cc5f7e6426ad5176a3fb120a17eafe70f0e20b4cb5179f31117d
@@ -15,7 +15,7 @@ module Spotlight
15
15
  def apply_browse_category_defaults(solr_params)
16
16
  return unless current_browse_category
17
17
 
18
- solr_params.merge!(browse_category_search_builder.to_hash)
18
+ solr_params.merge!(browse_category_search_builder.to_hash.except(:q))
19
19
  end
20
20
 
21
21
  def fix_up_browse_category_defaults(solr_params)
@@ -25,14 +25,27 @@ module Spotlight
25
25
  end
26
26
 
27
27
  def fix_up_browse_category_queries(solr_params)
28
- return unless solr_params.dig(:json, :query, :bool, :must) && blacklight_params[:q]
28
+ return unless current_browse_category
29
+
30
+ query = browse_category_search_builder.to_hash[:q]
31
+
32
+ solr_params.append_query(query) if query.present?
33
+
34
+ # for a browse category formed from a saved search, the query syntax reads as two "must" values
35
+ # e.g. "json"=>{"query"=>{"bool"=>{"must"=>["savedsearchterm", "browsecategorysearchterm"]}}}}
36
+ must_values = solr_params.dig(:json, :query, :bool, :must)
37
+
38
+ return unless must_values&.any?
39
+
40
+ # this type of query must be parsed by lucene to function
41
+ solr_params[:defType] = 'lucene'
29
42
 
30
43
  # This replicates existing spotlight 2.x search behavior, more or less. It
31
44
  # doesn't take into account the possibility that the browse category query
32
45
  # could use a different search field (which.. doesn't have an existing UI
33
46
  # control.. and may require additional upstream work to properly encapsulate
34
47
  # the two query parameters)
35
- solr_params[:json][:query][:bool][:must].map! do |q|
48
+ must_values.map! do |q|
36
49
  q.is_a?(String) ? { edismax: { query: q } } : q
37
50
  end
38
51
  end
@@ -53,7 +53,7 @@ module Spotlight
53
53
  data: [document].to_json,
54
54
  headers: { 'Content-Type' => 'application/json' }
55
55
  rescue StandardError => e
56
- pipeline&.on_error(self, e, document.to_json)
56
+ pipeline&.on_error(e, document.to_json)
57
57
  end
58
58
 
59
59
  def blacklight_solr
@@ -801,7 +801,7 @@ en:
801
801
  note_provenance_tesim: Provenance
802
802
  note_references_tesim: References
803
803
  note_source_tesim: Source
804
- personal_name_ssm: Personal names
804
+ personal_name_ssim: Personal names
805
805
  search:
806
806
  all_fields: Everything
807
807
  author: Author
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '3.5.0.2'
4
+ VERSION = '3.5.0.4'
5
5
  end
@@ -30,4 +30,16 @@ FactoryBot.define do
30
30
 
31
31
  after(:build) { |search| search.thumbnail = FactoryBot.create(:featured_image) }
32
32
  end
33
+
34
+ factory :search_field_search, class: 'Spotlight::Search' do
35
+ exhibit
36
+ title { 'Based on a search field' }
37
+ query_params { { 'search_field' => 'search', 'q' => 'model' } }
38
+ end
39
+
40
+ factory :facet_search, class: 'Spotlight::Search' do
41
+ exhibit
42
+ title { 'Based on a facet' }
43
+ query_params { { 'f' => { 'language_ssim' => 'Latin' } } }
44
+ end
33
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0.2
4
+ version: 3.5.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2022-07-28 00:00:00.000000000 Z
14
+ date: 2024-07-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -773,6 +773,20 @@ dependencies:
773
773
  - - "~>"
774
774
  - !ruby/object:Gem::Version
775
775
  version: '1.8'
776
+ - !ruby/object:Gem::Dependency
777
+ name: rubocop-capybara
778
+ requirement: !ruby/object:Gem::Requirement
779
+ requirements:
780
+ - - ">="
781
+ - !ruby/object:Gem::Version
782
+ version: '0'
783
+ type: :development
784
+ prerelease: false
785
+ version_requirements: !ruby/object:Gem::Requirement
786
+ requirements:
787
+ - - ">="
788
+ - !ruby/object:Gem::Version
789
+ version: '0'
776
790
  - !ruby/object:Gem::Dependency
777
791
  name: rubocop-rails
778
792
  requirement: !ruby/object:Gem::Requirement
@@ -871,20 +885,6 @@ dependencies:
871
885
  - - ">="
872
886
  - !ruby/object:Gem::Version
873
887
  version: '0'
874
- - !ruby/object:Gem::Dependency
875
- name: webdrivers
876
- requirement: !ruby/object:Gem::Requirement
877
- requirements:
878
- - - ">="
879
- - !ruby/object:Gem::Version
880
- version: '0'
881
- type: :development
882
- prerelease: false
883
- version_requirements: !ruby/object:Gem::Requirement
884
- requirements:
885
- - - ">="
886
- - !ruby/object:Gem::Version
887
- version: '0'
888
888
  - !ruby/object:Gem::Dependency
889
889
  name: webmock
890
890
  requirement: !ruby/object:Gem::Requirement
@@ -1607,7 +1607,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1607
1607
  - !ruby/object:Gem::Version
1608
1608
  version: '0'
1609
1609
  requirements: []
1610
- rubygems_version: 3.3.7
1610
+ rubygems_version: 3.4.19
1611
1611
  signing_key:
1612
1612
  specification_version: 4
1613
1613
  summary: Enable librarians, curators, and others who are responsible for digital collections