ebsco-eds 1.0.9 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ebsco-eds.gemspec +2 -2
- data/lib/ebsco/eds/configuration.rb +2 -1
- data/lib/ebsco/eds/results.rb +4 -1
- data/lib/ebsco/eds/session.rb +14 -6
- data/lib/ebsco/eds/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a98621f9b0ef365e1fca3f814127d8a1a20ff7fa70113d254c2ff90d33b62777
|
4
|
+
data.tar.gz: 639b960e78cbe5c01aaaefc88b524286371a7c6aca32c9c16dc26e70b99b3b97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b50c885e10fd0c126736c69af927e5d69e76eb3af3c3985f63acdcf49c385f9285bbee9bd4185b177d64279ad8778218a665fd51c01efd957113c75431ef0c1
|
7
|
+
data.tar.gz: 848222290962eec5901b0bf0f871e64ed8066a375aea7785a8ca1066ac3d84a03f1f513388886049b33958eeb8d9e4230911b276c6fdac7a13eaffcdf080ace0
|
data/ebsco-eds.gemspec
CHANGED
@@ -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 = ['
|
10
|
-
spec.email = ['
|
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'
|
data/lib/ebsco/eds/results.rb
CHANGED
@@ -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.'
|
data/lib/ebsco/eds/session.rb
CHANGED
@@ -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
|
-
|
484
|
-
|
485
|
-
|
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
|
data/lib/ebsco/eds/version.rb
CHANGED
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
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
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
|
-
-
|
374
|
+
- mdale@ebsco.com, efrierson@ebsco.com
|
375
375
|
executables: []
|
376
376
|
extensions: []
|
377
377
|
extra_rdoc_files: []
|