blacklight-spotlight 3.5.0.2 → 3.5.0.3

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: 42d2555f8a1c4195b162f1372cee92830f15d5c8352fdd2feded4adfc20b91e2
4
+ data.tar.gz: 8767e5e3c753bb98e591652dba94e2e87f5be6010ef4d200c22c3442cd7eefcc
5
5
  SHA512:
6
- metadata.gz: 6ab409d1cb4743910da14cc580d2048fe18a798edcbaa5b5dcbf93c67b1a7c9a6e40a9647a44262d369e13830cf7e3a0419278c18a3de58bbb70a2df93933716
7
- data.tar.gz: 900d4dec2ff3596e0f9ee37f66b118419317eb8c1a2931827a1ed3ebb117a3a6324e9358bb660180f94c63427db39520b3663e8cb167afc2db4d54bd01ef86a5
6
+ metadata.gz: 694f8dc2ff14e68d703885794e7aab5de87068c184019dd4cefcad719319cdbd152ca5df6a050dcc57fcb5dde2ae35ca41915bbf12a867d9ba3e7b06eebf4c70
7
+ data.tar.gz: 165f58ec01b4acd613c0b95fb25955f4dda3347c779b48e725cb855c6f689c09b811171160444f2677036d4685fb5c9427ecf33196e151b526af0e5356caadbb
@@ -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
@@ -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.3'
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.3
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-01-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -871,20 +871,6 @@ dependencies:
871
871
  - - ">="
872
872
  - !ruby/object:Gem::Version
873
873
  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
874
  - !ruby/object:Gem::Dependency
889
875
  name: webmock
890
876
  requirement: !ruby/object:Gem::Requirement
@@ -1607,7 +1593,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1607
1593
  - !ruby/object:Gem::Version
1608
1594
  version: '0'
1609
1595
  requirements: []
1610
- rubygems_version: 3.3.7
1596
+ rubygems_version: 3.4.10
1611
1597
  signing_key:
1612
1598
  specification_version: 4
1613
1599
  summary: Enable librarians, curators, and others who are responsible for digital collections