ebsco-eds 1.0.9 → 1.1.0

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
  SHA256:
3
- metadata.gz: b6540dd6a4557914c9126f0c71ede4b796f24d26cea5434f134e5cbcbdbf23f3
4
- data.tar.gz: a1a0f31fa32e934e7a7068d4b21b1ee57bf547ac432a03e02d3fb93590c871d8
3
+ metadata.gz: a98621f9b0ef365e1fca3f814127d8a1a20ff7fa70113d254c2ff90d33b62777
4
+ data.tar.gz: 639b960e78cbe5c01aaaefc88b524286371a7c6aca32c9c16dc26e70b99b3b97
5
5
  SHA512:
6
- metadata.gz: cd6f151c9d6ec779f3bb8dc7cf06dd6950be6ed2e91f4e5cf72cb250603aad08cbb38591b3e06ed0f74de943c4bb8377f4b05f2ed7a0e09a635fff4cb88e9379
7
- data.tar.gz: 526d2b6ee244df0d90c1616d30543f4eb1125d4e93bf47cfdd14ed449ca11d89fbe80060b0cbe6f747a530a8f3ff6815df7e26ba23a2c2e655df40e19a98a3e8
6
+ metadata.gz: 4b50c885e10fd0c126736c69af927e5d69e76eb3af3c3985f63acdcf49c385f9285bbee9bd4185b177d64279ad8778218a665fd51c01efd957113c75431ef0c1
7
+ data.tar.gz: 848222290962eec5901b0bf0f871e64ed8066a375aea7785a8ca1066ac3d84a03f1f513388886049b33958eeb8d9e4230911b276c6fdac7a13eaffcdf080ace0
@@ -6,8 +6,8 @@ require 'ebsco/eds/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'ebsco-eds'
8
8
  spec.version = EBSCO::EDS::VERSION
9
- spec.authors = ['Bill McKinney','Eric Frierson']
10
- spec.email = ['bmckinney@ebsco.com, efrierson@ebsco.com']
9
+ spec.authors = ['Madeline Dale','Eric Frierson']
10
+ spec.email = ['mdale@ebsco.com, efrierson@ebsco.com']
11
11
  spec.summary = 'Summary: EBSCO EDS API'
12
12
  spec.description = 'Description: EBSCO EDS API'
13
13
  spec.homepage = 'https://github.com/ebsco/edsapi-ruby'
@@ -59,7 +59,8 @@ module EBSCO
59
59
  :ris_link_find => '',
60
60
  :ris_link_replace => '',
61
61
  :ris_db_find => '',
62
- :ris_db_replace => ''
62
+ :ris_db_replace => '',
63
+ :smarttext_failover => false
63
64
  }
64
65
  @valid_config_keys = @config.keys
65
66
  end
@@ -29,7 +29,7 @@ module EBSCO
29
29
 
30
30
  # Creates search results from the \EDS API search response. It includes information about the results and a list
31
31
  # of Record items.
32
- def initialize(search_results, eds_config = {}, additional_limiters = {}, options = {})
32
+ def initialize(search_results, eds_config = {}, additional_limiters = {}, options = {}, smarttext_failover = false)
33
33
 
34
34
  @results = search_results
35
35
 
@@ -103,6 +103,9 @@ module EBSCO
103
103
  # titleize facets
104
104
  @titleize_facets = %w[Language Journal SubjectEDS SubjectGeographic Publisher]
105
105
 
106
+ # set flag that query was rerun with smarttext after no results were found
107
+ @smarttext_failover = smarttext_failover
108
+
106
109
  else
107
110
  # response isn't a hash (eg, html error page)
108
111
  raise EBSCO::EDS::ApiError, 'EBSCO API error: Query failed.'
@@ -243,11 +243,15 @@ module EBSCO
243
243
  if @search_options.nil? || !add_actions
244
244
  @search_options = EBSCO::EDS::Options.new(options, @info)
245
245
  end
246
-
247
246
  _response = do_request(:post, path: '/edsapi/rest/Search', payload: @search_options)
248
247
  @search_results = EBSCO::EDS::Results.new(_response, @config,
249
248
  @info.available_limiters, options)
250
-
249
+ if @search_results.stat_total_hits.to_i == 0 && @config[:smarttext_failover] == true
250
+ @search_options.add_actions('SetSearchMode(smart)', @info)
251
+ _response = do_request(:post, path: '/edsapi/rest/Search', payload: @search_options)
252
+ @search_results = EBSCO::EDS::Results.new(_response, @config,
253
+ @info.available_limiters, options, true)
254
+ end
251
255
  # create temp format facet results if needed
252
256
  if options['f']
253
257
  if options['f'].key?('eds_publication_type_facet')
@@ -480,9 +484,13 @@ module EBSCO
480
484
  list.each.with_index(1) { |id, index|
481
485
  dbid = id.split('__',2).first
482
486
  accession = id.split('__',2).last
483
- current_rec = retrieve(dbid: dbid, an: accession, highlight: highlight, ebook: @config[:ebook_preferred_format])
484
- current_rec.eds_result_id = index
485
- records.push current_rec
487
+ begin
488
+ current_rec = retrieve(dbid: dbid, an: accession, highlight: highlight, ebook: @config[:ebook_preferred_format])
489
+ current_rec.eds_result_id = index
490
+ records.push current_rec
491
+ rescue EBSCO::EDS::BadRequest, EBSCO::EDS::NotFound => e
492
+ puts "Request for #{id} in #{self.class.name}#solr_retrieve_list failed with #{e}" if @debug
493
+ end
486
494
  }
487
495
  end
488
496
  r = empty_results(records.length)
@@ -1261,4 +1269,4 @@ module EBSCO
1261
1269
 
1262
1270
  end
1263
1271
  end
1264
- end
1272
+ end
@@ -1,5 +1,5 @@
1
1
  module EBSCO
2
2
  module EDS
3
- VERSION = '1.0.9'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebsco-eds
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Bill McKinney
7
+ - Madeline Dale
8
8
  - Eric Frierson
9
9
  autorequire:
10
10
  bindir: exe
@@ -371,7 +371,7 @@ dependencies:
371
371
  version: '3.6'
372
372
  description: 'Description: EBSCO EDS API'
373
373
  email:
374
- - bmckinney@ebsco.com, efrierson@ebsco.com
374
+ - mdale@ebsco.com, efrierson@ebsco.com
375
375
  executables: []
376
376
  extensions: []
377
377
  extra_rdoc_files: []