search_solr_tools 3.10.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +45 -1
- data/README.md +30 -14
- data/bin/search_solr_tools +20 -22
- data/lib/search_solr_tools.rb +6 -7
- data/lib/search_solr_tools/config/environments.yaml +7 -8
- data/lib/search_solr_tools/harvesters/adc.rb +2 -0
- data/lib/search_solr_tools/harvesters/ade_auto_suggest.rb +2 -0
- data/lib/search_solr_tools/harvesters/auto_suggest.rb +1 -0
- data/lib/search_solr_tools/harvesters/base.rb +2 -2
- data/lib/search_solr_tools/harvesters/bcodmo.rb +1 -0
- data/lib/search_solr_tools/harvesters/data_one.rb +2 -0
- data/lib/search_solr_tools/harvesters/echo.rb +2 -0
- data/lib/search_solr_tools/harvesters/gtnp.rb +1 -0
- data/lib/search_solr_tools/harvesters/ices.rb +1 -0
- data/lib/search_solr_tools/harvesters/ncdc_paleo.rb +1 -0
- data/lib/search_solr_tools/harvesters/nmi.rb +2 -0
- data/lib/search_solr_tools/harvesters/nodc.rb +2 -0
- data/lib/search_solr_tools/harvesters/nsidc_auto_suggest.rb +2 -0
- data/lib/search_solr_tools/harvesters/nsidc_json.rb +8 -1
- data/lib/search_solr_tools/harvesters/oai.rb +2 -0
- data/lib/search_solr_tools/harvesters/pdc.rb +2 -0
- data/lib/search_solr_tools/harvesters/r2r.rb +2 -2
- data/lib/search_solr_tools/harvesters/rda.rb +2 -0
- data/lib/search_solr_tools/harvesters/tdar.rb +2 -0
- data/lib/search_solr_tools/harvesters/usgs.rb +2 -0
- data/lib/search_solr_tools/helpers/data_one_format.rb +3 -3
- data/lib/search_solr_tools/helpers/facet_configuration.rb +1 -1
- data/lib/search_solr_tools/helpers/iso_to_solr.rb +4 -3
- data/lib/search_solr_tools/helpers/iso_to_solr_format.rb +2 -2
- data/lib/search_solr_tools/helpers/ncdc_paleo_format.rb +3 -3
- data/lib/search_solr_tools/helpers/r2r_format.rb +3 -3
- data/lib/search_solr_tools/helpers/selectors.rb +1 -2
- data/lib/search_solr_tools/helpers/solr_format.rb +1 -0
- data/lib/search_solr_tools/helpers/tdar_format.rb +3 -3
- data/lib/search_solr_tools/helpers/translate_spatial_coverage.rb +3 -3
- data/lib/search_solr_tools/helpers/translate_temporal_coverage.rb +1 -1
- data/lib/search_solr_tools/helpers/usgs_format.rb +2 -2
- data/lib/search_solr_tools/selectors/adc.rb +2 -1
- data/lib/search_solr_tools/selectors/data_one.rb +2 -1
- data/lib/search_solr_tools/selectors/echo_iso.rb +2 -1
- data/lib/search_solr_tools/selectors/ices_iso.rb +2 -1
- data/lib/search_solr_tools/selectors/ncdc_paleo.rb +2 -1
- data/lib/search_solr_tools/selectors/nmi.rb +2 -1
- data/lib/search_solr_tools/selectors/nodc_iso.rb +2 -1
- data/lib/search_solr_tools/selectors/pdc_iso.rb +2 -1
- data/lib/search_solr_tools/selectors/r2r.rb +3 -1
- data/lib/search_solr_tools/selectors/rda.rb +2 -1
- data/lib/search_solr_tools/selectors/tdar_opensearch.rb +3 -1
- data/lib/search_solr_tools/selectors/usgs_iso.rb +3 -1
- data/lib/search_solr_tools/translators/eol_to_solr.rb +2 -0
- data/lib/search_solr_tools/version.rb +1 -1
- data/search_solr_tools.gemspec +21 -22
- metadata +44 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c22c657599dd75b0f4e04961da160ed73ac0c6b4e787b3e1545befa5292e801d
|
4
|
+
data.tar.gz: fec281b34ff09a897032587eb22dfbf4f70a66f39dc6d27b1d2cb19979cb810e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b594152e0c38dde528956ab498010d3920918bf0e9d1566213ab1ab6d6a2733766c62a18f7c69016d35ab939131c561b762a6fb208aa2cb21c294cbced5d7da
|
7
|
+
data.tar.gz: 20445ab31dada428637e003b0c6143b7ae39d350222d45f3e5916cafc81f6735341a1b197cd6990b1acf888b5802ce2ca5c5c32e1cb3a98e72d497bda1adb964
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,53 @@
|
|
1
|
-
##
|
1
|
+
## Unreleased
|
2
|
+
|
3
|
+
- Update Ruby to 2.6.5, update gem dependencies to more recent version.
|
4
|
+
- Updates to correspond with an update to Solr 8.5.2
|
5
|
+
|
6
|
+
## v4.2.1 (2019-08-13)
|
7
|
+
|
8
|
+
- Patch release to include updated CHANGELOG.
|
9
|
+
|
10
|
+
## v4.2.0 (2019-08-12)
|
11
|
+
|
12
|
+
- Update dataset-catalog-services URL to only fetch current (*not* retired)
|
13
|
+
metadata records.
|
14
|
+
- Add a few more gem release notes to README.
|
15
|
+
|
16
|
+
Note: v4.1.0 was prematurely released and, in theory, yanked. However, on the
|
17
|
+
second try at publishing 4.1.0, Rubygems complained about the attempt to
|
18
|
+
republish a gem. The version was therefore bumped again to 4.2.0 as the path of
|
19
|
+
least resistance to a successful publish. v4.1.0 should not be used.
|
20
|
+
|
21
|
+
## v4.0.1 (2019-07-08)
|
22
|
+
|
23
|
+
- Update CHANGELOG and release instructions.
|
24
|
+
- Fix README typo.
|
25
|
+
|
26
|
+
## v4.0.0 (2019-07-08)
|
27
|
+
|
28
|
+
Changes:
|
29
|
+
|
30
|
+
- Update spatial field formatting to work with Solr 8.1.1.
|
31
|
+
|
32
|
+
## v3.11.0 (2019-06-10)
|
33
|
+
|
34
|
+
Changes:
|
35
|
+
|
36
|
+
- Update Ruby, Nokogiri, RestClient, Rubocop, and Webmock versions to address
|
37
|
+
security warnings.
|
38
|
+
- Update syntax as necessary for new versions of Rubocop and RestClient.
|
39
|
+
|
40
|
+
## v3.10.0 (2017-04-10)
|
2
41
|
|
3
42
|
Changes
|
4
43
|
|
5
44
|
- Constrain ADC and ECHO feeds to only fetch records in the arctic.
|
6
45
|
|
46
|
+
Note
|
47
|
+
- v3.9.1 and v3.10.0 were mistakenly released after version 3.9.0 was
|
48
|
+
tagged. All three versions are identical, although v3.9.0 was never
|
49
|
+
released to rubygems.org.
|
50
|
+
|
7
51
|
## v3.8.4 (2017-03-30)
|
8
52
|
|
9
53
|
Bugfix
|
data/README.md
CHANGED
@@ -61,7 +61,7 @@ Once you have the gem built in the project directory, install the utility:
|
|
61
61
|
|
62
62
|
### Requirements
|
63
63
|
|
64
|
-
* Ruby > 2.
|
64
|
+
* Ruby > 2.6.5
|
65
65
|
* [Bundler](http://bundler.io/)
|
66
66
|
* Requirements for nokogiri:
|
67
67
|
* [libxml2/libxml2-dev](http://xmlsoft.org/)
|
@@ -105,7 +105,7 @@ Please be sure to run them in the `bundle exec` context if you're utilizing bund
|
|
105
105
|
|
106
106
|
Requirements:
|
107
107
|
|
108
|
-
* Ruby > 2.
|
108
|
+
* Ruby > 2.6.5
|
109
109
|
* [Bundler](http://bundler.io/)
|
110
110
|
* [Gem Release](https://github.com/svenfuchs/gem-release)
|
111
111
|
* [Rake](https://github.com/ruby/rake)
|
@@ -113,6 +113,10 @@ Requirements:
|
|
113
113
|
[ownership](http://guides.rubygems.org/publishing/) of the gem
|
114
114
|
* RuboCop and the unit tests should all pass (`rake`)
|
115
115
|
|
116
|
+
The [CHANGELOG.md](CHANGELOG.md) is not automatically updated by the
|
117
|
+
`rake release:*` tasks. Update it manually to insert the correct version and
|
118
|
+
date, and commit the file, before creating the release package.
|
119
|
+
|
116
120
|
**gem release** is used by rake tasks in this project to handle version changes,
|
117
121
|
tagging, and publishing to RubyGems.
|
118
122
|
|
@@ -130,16 +134,28 @@ tagging, and publishing to RubyGems.
|
|
130
134
|
* the changes are pushed
|
131
135
|
* the tagged version is built and published to RubyGems
|
132
136
|
|
133
|
-
|
137
|
+
You will need to have a current Rubygems API key for the _NSIDC developer user_ account in
|
138
|
+
order to publish a new version of the gem to Rubygems. To get the lastest API key:
|
139
|
+
|
140
|
+
`curl -u <username> https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials`
|
141
|
+
|
142
|
+
## Release steps (summary)
|
143
|
+
|
144
|
+
- Confirm no errors are returned by `bundle exec rubocop`
|
145
|
+
- Confirm all tests pass (`bundle exec rake spec:unit`)
|
146
|
+
- Update the version number and date manually in `CHANGELOG.md` and commit the
|
147
|
+
changes.
|
148
|
+
- Run the appropriate `bundle exec rake release:*` task
|
149
|
+
|
150
|
+
### SOLR
|
134
151
|
|
135
|
-
To harvest data utilizing the gem, you will need
|
136
|
-
|
137
|
-
[Apache's archive](https://archive.apache.org/dist/lucene/solr/4.3.0/).
|
152
|
+
To harvest data utilizing the gem, you will need an installed instance of [Solr
|
153
|
+
8.5.3](https://lucene.apache.org/solr/guide/)
|
138
154
|
|
139
155
|
#### NSIDC
|
140
156
|
|
141
157
|
At NSIDC the development VM can be provisioned with the
|
142
|
-
[solr puppet module](https://bitbucket.org/nsidc/puppet-solr/) to install and
|
158
|
+
[solr puppet module](https://bitbucket.org/nsidc/puppet-nsidc-solr/) to install and
|
143
159
|
configure Solr.
|
144
160
|
|
145
161
|
#### Non-NSIDC
|
@@ -172,17 +188,17 @@ the `--environment` flag when running `search_solr_tools harvest`.
|
|
172
188
|
|
173
189
|
### How to contact NSIDC
|
174
190
|
|
175
|
-
User Services and general information:
|
176
|
-
Support: [http://support.nsidc.org](http://support.nsidc.org)
|
191
|
+
User Services and general information:
|
192
|
+
Support: [http://support.nsidc.org](http://support.nsidc.org)
|
177
193
|
Email: nsidc@nsidc.org
|
178
194
|
|
179
|
-
Phone: +1 303.492.6199
|
195
|
+
Phone: +1 303.492.6199
|
180
196
|
Fax: +1 303.492.2468
|
181
197
|
|
182
|
-
Mailing address:
|
183
|
-
National Snow and Ice Data Center
|
184
|
-
CIRES, 449 UCB
|
185
|
-
University of Colorado
|
198
|
+
Mailing address:
|
199
|
+
National Snow and Ice Data Center
|
200
|
+
CIRES, 449 UCB
|
201
|
+
University of Colorado
|
186
202
|
Boulder, CO 80309-0449 USA
|
187
203
|
|
188
204
|
### License
|
data/bin/search_solr_tools
CHANGED
@@ -1,27 +1,29 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
require 'search_solr_tools'
|
3
5
|
require 'thor'
|
4
6
|
|
5
7
|
class SolrHarvestCLI < Thor
|
6
|
-
map %w
|
8
|
+
map %w[--version -v] => :__print_version
|
7
9
|
|
8
10
|
desc '--version, -v', 'print the version'
|
9
11
|
def __print_version
|
10
12
|
puts SearchSolrTools::VERSION
|
11
13
|
end
|
12
14
|
|
13
|
-
desc 'harvest', 'Harvest from
|
15
|
+
desc 'harvest', 'Harvest from the specified data centers'
|
14
16
|
option :data_center, type: :array, required: true
|
15
17
|
option :environment, required: true
|
16
18
|
option :die_on_failure, type: :boolean
|
17
19
|
def harvest(die_on_failure = options[:die_on_failure] || false)
|
18
20
|
options[:data_center].each do |target|
|
19
|
-
puts target
|
21
|
+
puts "Target: #{target}"
|
20
22
|
begin
|
21
23
|
harvest_class = get_harvester_class(target)
|
22
24
|
harvester = harvest_class.new(options[:environment], die_on_failure)
|
23
25
|
harvester.harvest_and_delete
|
24
|
-
rescue => e
|
26
|
+
rescue StandardError => e
|
25
27
|
puts "harvest failed for #{target}: #{e.message}"
|
26
28
|
raise e
|
27
29
|
end
|
@@ -64,30 +66,26 @@ class SolrHarvestCLI < Thor
|
|
64
66
|
no_tasks do
|
65
67
|
def harvester_map
|
66
68
|
{
|
67
|
-
'bco_dmo'
|
68
|
-
'adc'
|
69
|
-
'
|
70
|
-
'
|
71
|
-
'
|
72
|
-
'
|
73
|
-
'
|
74
|
-
'
|
75
|
-
'
|
76
|
-
'
|
77
|
-
'
|
78
|
-
'
|
79
|
-
'usgs' => SearchSolrTools::Harvesters::Usgs,
|
80
|
-
'tdar' => SearchSolrTools::Harvesters::Tdar,
|
81
|
-
'pdc' => SearchSolrTools::Harvesters::Pdc,
|
82
|
-
'nsidc' => SearchSolrTools::Harvesters::NsidcJson,
|
69
|
+
'bco_dmo' => SearchSolrTools::Harvesters::BcoDmo,
|
70
|
+
'adc' => SearchSolrTools::Harvesters::Adc,
|
71
|
+
'echo' => SearchSolrTools::Harvesters::Echo,
|
72
|
+
'ices' => SearchSolrTools::Harvesters::Ices,
|
73
|
+
'nmi' => SearchSolrTools::Harvesters::Nmi,
|
74
|
+
'nodc' => SearchSolrTools::Harvesters::Nodc,
|
75
|
+
'r2r' => SearchSolrTools::Harvesters::R2R,
|
76
|
+
'rda' => SearchSolrTools::Harvesters::Rda,
|
77
|
+
'usgs' => SearchSolrTools::Harvesters::Usgs,
|
78
|
+
'tdar' => SearchSolrTools::Harvesters::Tdar,
|
79
|
+
'pdc' => SearchSolrTools::Harvesters::Pdc,
|
80
|
+
'nsidc' => SearchSolrTools::Harvesters::NsidcJson,
|
83
81
|
'nsidc_auto_suggest' => SearchSolrTools::Harvesters::NsidcAutoSuggest,
|
84
|
-
'ade_auto_suggest'
|
82
|
+
'ade_auto_suggest' => SearchSolrTools::Harvesters::AdeAutoSuggest
|
85
83
|
}
|
86
84
|
end
|
87
85
|
|
88
86
|
def get_harvester_class(data_center_name)
|
89
87
|
name = data_center_name.downcase.to_s
|
90
|
-
|
88
|
+
raise("Invalid data center #{name}") unless harvester_map.key?(name)
|
91
89
|
|
92
90
|
harvester_map[name]
|
93
91
|
end
|
data/lib/search_solr_tools.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
|
2
|
-
require_relative '
|
3
|
-
require_relative './search_solr_tools/version'
|
1
|
+
require_relative 'search_solr_tools/config/environments'
|
2
|
+
require_relative 'search_solr_tools/version'
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
require_relative 'search_solr_tools/helpers/selectors'
|
5
|
+
%w( selectors harvesters translators ).each do |subdir|
|
6
|
+
Dir[File.join(__dir__, 'search_solr_tools', subdir, '*.rb')].each { |file| require file }
|
7
|
+
end
|
@@ -36,39 +36,38 @@
|
|
36
36
|
- http://data.eol.ucar.edu/jedi/catalog/ucar.ncar.eol.project.ITEX.thredds.xml
|
37
37
|
:r2r_url: http://get.rvdata.us/services/cruise/
|
38
38
|
|
39
|
+
# Not using DCS API v2 here because not all retired datasets have their "retired"
|
40
|
+
# flag checked. For example, GLA01.033 is retired; GLA01.018 is not, but it
|
41
|
+
# should be. GLA01.018 will show up if we use DCS API v2.
|
42
|
+
:nsidc_oai_identifiers_url: oai?verb=ListIdentifiers&metadata_prefix=iso&retired=false
|
43
|
+
|
39
44
|
:local:
|
40
45
|
:host: localhost
|
41
46
|
:nsidc_dataset_metadata_url: http://integration.nsidc.org/api/dataset/metadata/
|
42
|
-
:nsidc_oai_identifiers_url: http://integration.nsidc.org/api/dataset/metadata/oai?verb=ListIdentifiers&metadata_prefix=iso
|
43
47
|
|
44
48
|
:dev:
|
45
49
|
## For the below, you'll need to instantiate your own search-solr instance, and point host to that.
|
46
50
|
:host: dev.search-solr.USERNAME.dev.int.nsidc.org
|
47
|
-
## For
|
51
|
+
## For the metadata content, either set up your own instance of dataset-catalog-services
|
52
|
+
## or change the URL below to point to integration
|
48
53
|
:nsidc_dataset_metadata_url: http://dev.dcs.USERNAME.dev.int.nsidc.org:1580/api/dataset/metadata/
|
49
|
-
:nsidc_oai_identifiers_url: http://dev.dcs.USERNAME.dev.int.nsidc.org:1580/api/dataset/metadata/oai?verb=ListIdentifiers&metadata_prefix=iso
|
50
54
|
|
51
55
|
:integration:
|
52
56
|
:host: integration.search-solr.apps.int.nsidc.org
|
53
57
|
:nsidc_dataset_metadata_url: http://integration.nsidc.org/api/dataset/metadata/
|
54
|
-
:nsidc_oai_identifiers_url: http://integration.nsidc.org/api/dataset/metadata/oai?verb=ListIdentifiers&metadata_prefix=iso
|
55
58
|
|
56
59
|
:qa:
|
57
60
|
:host: qa.search-solr.apps.int.nsidc.org
|
58
61
|
:nsidc_dataset_metadata_url: http://qa.nsidc.org/api/dataset/metadata/
|
59
|
-
:nsidc_oai_identifiers_url: http://qa.nsidc.org/api/dataset/metadata/oai?verb=ListIdentifiers&metadata_prefix=iso
|
60
62
|
|
61
63
|
:staging:
|
62
64
|
:host: staging.search-solr.apps.int.nsidc.org
|
63
65
|
:nsidc_dataset_metadata_url: http://staging.nsidc.org/api/dataset/metadata/
|
64
|
-
:nsidc_oai_identifiers_url: http://staging.nsidc.org/api/dataset/metadata/oai?verb=ListIdentifiers&metadata_prefix=iso
|
65
66
|
|
66
67
|
:blue:
|
67
68
|
:host: blue.search-solr.apps.int.nsidc.org
|
68
69
|
:nsidc_dataset_metadata_url: http://nsidc.org/api/dataset/metadata/
|
69
|
-
:nsidc_oai_identifiers_url: http://nsidc.org/api/dataset/metadata/oai?verb=ListIdentifiers&metadata_prefix=iso
|
70
70
|
|
71
71
|
:production:
|
72
72
|
:host: search-solr.apps.int.nsidc.org
|
73
73
|
:nsidc_dataset_metadata_url: http://nsidc.org/api/dataset/metadata/
|
74
|
-
:nsidc_oai_identifiers_url: http://nsidc.org/api/dataset/metadata/oai?verb=ListIdentifiers&metadata_prefix=iso
|
@@ -43,7 +43,7 @@ module SearchSolrTools
|
|
43
43
|
constraints = sanitize_data_centers_constraints(constraints)
|
44
44
|
delete_query = "last_update:[* TO #{timestamp}] AND #{constraints}"
|
45
45
|
solr = RSolr.connect url: solr_url + "/#{solr_core}"
|
46
|
-
unchanged_count = (solr.get 'select', params: { q: delete_query, rows: 0 })['response']['numFound'].to_i
|
46
|
+
unchanged_count = (solr.get 'select', params: { wt: :ruby, q: delete_query, rows: 0 })['response']['numFound'].to_i
|
47
47
|
if unchanged_count == 0
|
48
48
|
puts "All documents were updated after #{timestamp}, nothing to delete"
|
49
49
|
else
|
@@ -61,7 +61,7 @@ module SearchSolrTools
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def remove_documents(solr, delete_query, constraints, force, numfound)
|
64
|
-
all_response_count = (solr.get 'select', params: { q: constraints, rows: 0 })['response']['numFound']
|
64
|
+
all_response_count = (solr.get 'select', params: { wt: :ruby, q: constraints, rows: 0 })['response']['numFound']
|
65
65
|
if force || (numfound / all_response_count.to_f < DELETE_DOCUMENTS_RATIO)
|
66
66
|
puts "Deleting #{numfound} documents for #{constraints}"
|
67
67
|
solr.delete_by_query delete_query
|
@@ -31,9 +31,14 @@ module SearchSolrTools
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def result_ids_from_nsidc
|
34
|
-
|
34
|
+
url = SolrEnvironments[@environment][:nsidc_dataset_metadata_url] +
|
35
|
+
SolrEnvironments[@environment][:nsidc_oai_identifiers_url]
|
36
|
+
get_results url, '//xmlns:identifier'
|
35
37
|
end
|
36
38
|
|
39
|
+
# Fetch a JSON representation of a dataset's metadata
|
40
|
+
# @param id [String] NSIDC authoritative ID for the dataset
|
41
|
+
# @return [Hash] Parsed version of the JSON response
|
37
42
|
def fetch_json_from_nsidc(id)
|
38
43
|
json_response = RestClient.get(nsidc_json_url + id + '.json')
|
39
44
|
JSON.parse(json_response)
|
@@ -44,6 +49,8 @@ module SearchSolrTools
|
|
44
49
|
failure_ids = []
|
45
50
|
|
46
51
|
result_ids_from_nsidc.each do |r|
|
52
|
+
# Each result looks like:
|
53
|
+
# oai:nsidc.org/AE_L2A
|
47
54
|
id = r.text.split('/').last
|
48
55
|
begin
|
49
56
|
docs << { 'add' => { 'doc' => @translator.translate(fetch_json_from_nsidc(id)) } }
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require_relative '
|
2
|
-
require_relative '
|
3
|
-
require_relative '
|
1
|
+
require_relative 'iso_namespaces'
|
2
|
+
require_relative 'iso_to_solr_format'
|
3
|
+
require_relative 'solr_format'
|
4
4
|
|
5
5
|
module SearchSolrTools
|
6
6
|
module Helpers
|
@@ -8,7 +8,7 @@ module SearchSolrTools
|
|
8
8
|
class FacetConfiguration
|
9
9
|
include Singleton
|
10
10
|
def self.import_bin_configuration(env)
|
11
|
-
@bin_configuration = JSON.parse(RestClient.get(SolrEnvironments[env][:nsidc_dataset_metadata_url] + '
|
11
|
+
@bin_configuration = JSON.parse(RestClient.get(SolrEnvironments[env][:nsidc_dataset_metadata_url] + 'binConfiguration')) if @bin_configuration.nil?
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.get_facet_bin(facet_name)
|
@@ -1,10 +1,11 @@
|
|
1
|
+
require_relative 'selectors'
|
1
2
|
require 'nokogiri'
|
2
3
|
|
3
4
|
module SearchSolrTools
|
4
5
|
module Helpers
|
5
|
-
# Translates ISO nokogiri documents into solr nokogiri documents using a hash driver object
|
6
|
-
# This class should be constructed passing the selector file hash as a parameter (see selectors.rb)
|
7
|
-
#
|
6
|
+
# Translates ISO nokogiri documents into solr nokogiri documents using a hash driver object.
|
7
|
+
# This class should be constructed passing the selector file hash as a parameter (see selectors.rb).
|
8
|
+
# After creating an instance we call translate with a nokogiri iso document as a parameter.
|
8
9
|
class IsoToSolr
|
9
10
|
def initialize(selector)
|
10
11
|
@fields = SELECTORS[selector]
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'date'
|
2
2
|
|
3
|
-
require_relative '
|
4
|
-
require_relative '
|
5
|
-
require_relative '
|
3
|
+
require_relative 'iso_namespaces'
|
4
|
+
require_relative 'solr_format'
|
5
|
+
require_relative 'iso_to_solr_format'
|
6
6
|
|
7
7
|
module SearchSolrTools
|
8
8
|
module Helpers
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require_relative '
|
2
|
-
require_relative '
|
3
|
-
require_relative '
|
1
|
+
require_relative 'iso_namespaces'
|
2
|
+
require_relative 'iso_to_solr_format'
|
3
|
+
require_relative 'solr_format'
|
4
4
|
|
5
5
|
module SearchSolrTools
|
6
6
|
module Helpers
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require_relative '
|
2
|
-
require_relative '
|
3
|
-
require_relative '
|
1
|
+
require_relative 'iso_namespaces'
|
2
|
+
require_relative 'iso_to_solr_format'
|
3
|
+
require_relative 'solr_format'
|
4
4
|
|
5
5
|
module SearchSolrTools
|
6
6
|
module Helpers
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rgeo/geo_json'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative 'bounding_box_util'
|
4
|
+
require_relative 'iso_to_solr_format'
|
5
5
|
|
6
6
|
module SearchSolrTools
|
7
7
|
module Helpers
|
@@ -36,7 +36,7 @@ module SearchSolrTools
|
|
36
36
|
"#{geo_json.x} #{geo_json.y}"
|
37
37
|
else
|
38
38
|
bbox = RGeo::Cartesian::BoundingBox.create_from_geometry(geo_json)
|
39
|
-
"#{bbox.min_x} #{bbox.
|
39
|
+
"ENVELOPE(#{bbox.min_x}, #{bbox.max_x}, #{bbox.max_y}, #{bbox.min_y})"
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data/search_solr_tools.gemspec
CHANGED
@@ -7,8 +7,8 @@ gem_files = %(CHANGELOG.md COPYING README.md bin/ lib/ search_solr_tools.gemspec
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = 'search_solr_tools'
|
9
9
|
spec.version = SearchSolrTools::VERSION
|
10
|
-
spec.authors = ['Chris Chalstrom', 'Michael Brandt', 'Jonathan Kovarik', 'Luis Lopez', 'Stuart Reed']
|
11
|
-
spec.email = ['cchalstr@nsidc.org', 'mbrandt@colorado.edu', 'kovarik@nsidc.org', 'luis.lopezespinosa@colorado.edu', 'stuart.reed@colorado.edu']
|
10
|
+
spec.authors = ['Chris Chalstrom', 'Michael Brandt', 'Jonathan Kovarik', 'Luis Lopez', 'Stuart Reed', 'Julia Collins', 'Scott Lewis']
|
11
|
+
spec.email = ['cchalstr@nsidc.org', 'mbrandt@colorado.edu', 'kovarik@nsidc.org', 'luis.lopezespinosa@colorado.edu', 'stuart.reed@colorado.edu', 'jcollins@nsidc.org', 'scott.lewis@nsidc.org']
|
12
12
|
spec.summary = 'Tools to harvest and manage various scientific dataset feeds in a Solr instance.'
|
13
13
|
spec.description = <<-EOF
|
14
14
|
Ruby translators to transform various metadata feeds into solr documents and
|
@@ -23,25 +23,24 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.required_ruby_version = '~> 2.
|
26
|
+
spec.required_ruby_version = '~> 2.6.5'
|
27
27
|
|
28
|
-
spec.add_runtime_dependency 'ffi-geos', '~> 1.
|
29
|
-
spec.add_runtime_dependency 'iso8601', '~> 0.
|
30
|
-
spec.add_runtime_dependency 'multi_json', '~> 1.
|
31
|
-
spec.add_runtime_dependency 'nokogiri', '~> 1.
|
32
|
-
spec.add_runtime_dependency '
|
33
|
-
spec.add_runtime_dependency '
|
34
|
-
spec.add_runtime_dependency 'rgeo', '~>
|
35
|
-
spec.add_runtime_dependency '
|
36
|
-
spec.add_runtime_dependency '
|
37
|
-
spec.
|
38
|
-
spec.add_development_dependency '
|
39
|
-
spec.add_development_dependency 'guard', '~>
|
40
|
-
spec.add_development_dependency 'guard-
|
41
|
-
spec.add_development_dependency '
|
42
|
-
spec.add_development_dependency '
|
43
|
-
spec.add_development_dependency '
|
44
|
-
spec.add_development_dependency '
|
45
|
-
spec.add_development_dependency '
|
46
|
-
spec.add_development_dependency 'listen', '3.0.5'
|
28
|
+
spec.add_runtime_dependency 'ffi-geos', '~> 2.1.0'
|
29
|
+
spec.add_runtime_dependency 'iso8601', '~> 0.12.2'
|
30
|
+
spec.add_runtime_dependency 'multi_json', '~> 1.14.1'
|
31
|
+
spec.add_runtime_dependency 'nokogiri', '~> 1.10.9'
|
32
|
+
spec.add_runtime_dependency 'rest-client', '~> 2.1.0'
|
33
|
+
spec.add_runtime_dependency 'rgeo', '~> 2.1.1'
|
34
|
+
spec.add_runtime_dependency 'rgeo-geojson', '~> 2.1.1'
|
35
|
+
spec.add_runtime_dependency 'rsolr', '~> 2.3.0'
|
36
|
+
spec.add_runtime_dependency 'thor', '~> 1.0.1'
|
37
|
+
spec.add_development_dependency 'gem-release', '~> 2.1.1'
|
38
|
+
spec.add_development_dependency 'guard', '~> 2.16.2'
|
39
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.7.3'
|
40
|
+
spec.add_development_dependency 'guard-rubocop', '~> 1.3'
|
41
|
+
spec.add_development_dependency 'rake', '~> 13.0.1'
|
42
|
+
spec.add_development_dependency 'rspec', '~> 3.9.0'
|
43
|
+
spec.add_development_dependency 'rubocop', '~> 0.86.0'
|
44
|
+
spec.add_development_dependency 'webmock', '~> 3.8.3'
|
45
|
+
spec.add_development_dependency 'listen', '3.2.1'
|
47
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: search_solr_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Chalstrom
|
@@ -9,10 +9,12 @@ authors:
|
|
9
9
|
- Jonathan Kovarik
|
10
10
|
- Luis Lopez
|
11
11
|
- Stuart Reed
|
12
|
+
- Julia Collins
|
13
|
+
- Scott Lewis
|
12
14
|
autorequire:
|
13
15
|
bindir: bin
|
14
16
|
cert_chain: []
|
15
|
-
date:
|
17
|
+
date: 2020-07-02 00:00:00.000000000 Z
|
16
18
|
dependencies:
|
17
19
|
- !ruby/object:Gem::Dependency
|
18
20
|
name: ffi-geos
|
@@ -20,266 +22,252 @@ dependencies:
|
|
20
22
|
requirements:
|
21
23
|
- - "~>"
|
22
24
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.
|
25
|
+
version: 2.1.0
|
24
26
|
type: :runtime
|
25
27
|
prerelease: false
|
26
28
|
version_requirements: !ruby/object:Gem::Requirement
|
27
29
|
requirements:
|
28
30
|
- - "~>"
|
29
31
|
- !ruby/object:Gem::Version
|
30
|
-
version: 1.
|
32
|
+
version: 2.1.0
|
31
33
|
- !ruby/object:Gem::Dependency
|
32
34
|
name: iso8601
|
33
35
|
requirement: !ruby/object:Gem::Requirement
|
34
36
|
requirements:
|
35
37
|
- - "~>"
|
36
38
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
39
|
+
version: 0.12.2
|
38
40
|
type: :runtime
|
39
41
|
prerelease: false
|
40
42
|
version_requirements: !ruby/object:Gem::Requirement
|
41
43
|
requirements:
|
42
44
|
- - "~>"
|
43
45
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
46
|
+
version: 0.12.2
|
45
47
|
- !ruby/object:Gem::Dependency
|
46
48
|
name: multi_json
|
47
49
|
requirement: !ruby/object:Gem::Requirement
|
48
50
|
requirements:
|
49
51
|
- - "~>"
|
50
52
|
- !ruby/object:Gem::Version
|
51
|
-
version:
|
53
|
+
version: 1.14.1
|
52
54
|
type: :runtime
|
53
55
|
prerelease: false
|
54
56
|
version_requirements: !ruby/object:Gem::Requirement
|
55
57
|
requirements:
|
56
58
|
- - "~>"
|
57
59
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
60
|
+
version: 1.14.1
|
59
61
|
- !ruby/object:Gem::Dependency
|
60
62
|
name: nokogiri
|
61
63
|
requirement: !ruby/object:Gem::Requirement
|
62
64
|
requirements:
|
63
65
|
- - "~>"
|
64
66
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
67
|
+
version: 1.10.9
|
66
68
|
type: :runtime
|
67
69
|
prerelease: false
|
68
70
|
version_requirements: !ruby/object:Gem::Requirement
|
69
71
|
requirements:
|
70
72
|
- - "~>"
|
71
73
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
73
|
-
- !ruby/object:Gem::Dependency
|
74
|
-
name: require_all
|
75
|
-
requirement: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
77
|
-
- - "~>"
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '1.3'
|
80
|
-
type: :runtime
|
81
|
-
prerelease: false
|
82
|
-
version_requirements: !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - "~>"
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '1.3'
|
74
|
+
version: 1.10.9
|
87
75
|
- !ruby/object:Gem::Dependency
|
88
76
|
name: rest-client
|
89
77
|
requirement: !ruby/object:Gem::Requirement
|
90
78
|
requirements:
|
91
79
|
- - "~>"
|
92
80
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
81
|
+
version: 2.1.0
|
94
82
|
type: :runtime
|
95
83
|
prerelease: false
|
96
84
|
version_requirements: !ruby/object:Gem::Requirement
|
97
85
|
requirements:
|
98
86
|
- - "~>"
|
99
87
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
88
|
+
version: 2.1.0
|
101
89
|
- !ruby/object:Gem::Dependency
|
102
90
|
name: rgeo
|
103
91
|
requirement: !ruby/object:Gem::Requirement
|
104
92
|
requirements:
|
105
93
|
- - "~>"
|
106
94
|
- !ruby/object:Gem::Version
|
107
|
-
version:
|
95
|
+
version: 2.1.1
|
108
96
|
type: :runtime
|
109
97
|
prerelease: false
|
110
98
|
version_requirements: !ruby/object:Gem::Requirement
|
111
99
|
requirements:
|
112
100
|
- - "~>"
|
113
101
|
- !ruby/object:Gem::Version
|
114
|
-
version:
|
102
|
+
version: 2.1.1
|
115
103
|
- !ruby/object:Gem::Dependency
|
116
104
|
name: rgeo-geojson
|
117
105
|
requirement: !ruby/object:Gem::Requirement
|
118
106
|
requirements:
|
119
107
|
- - "~>"
|
120
108
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
109
|
+
version: 2.1.1
|
122
110
|
type: :runtime
|
123
111
|
prerelease: false
|
124
112
|
version_requirements: !ruby/object:Gem::Requirement
|
125
113
|
requirements:
|
126
114
|
- - "~>"
|
127
115
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
116
|
+
version: 2.1.1
|
129
117
|
- !ruby/object:Gem::Dependency
|
130
118
|
name: rsolr
|
131
119
|
requirement: !ruby/object:Gem::Requirement
|
132
120
|
requirements:
|
133
121
|
- - "~>"
|
134
122
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
123
|
+
version: 2.3.0
|
136
124
|
type: :runtime
|
137
125
|
prerelease: false
|
138
126
|
version_requirements: !ruby/object:Gem::Requirement
|
139
127
|
requirements:
|
140
128
|
- - "~>"
|
141
129
|
- !ruby/object:Gem::Version
|
142
|
-
version:
|
130
|
+
version: 2.3.0
|
143
131
|
- !ruby/object:Gem::Dependency
|
144
132
|
name: thor
|
145
133
|
requirement: !ruby/object:Gem::Requirement
|
146
134
|
requirements:
|
147
135
|
- - "~>"
|
148
136
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
137
|
+
version: 1.0.1
|
150
138
|
type: :runtime
|
151
139
|
prerelease: false
|
152
140
|
version_requirements: !ruby/object:Gem::Requirement
|
153
141
|
requirements:
|
154
142
|
- - "~>"
|
155
143
|
- !ruby/object:Gem::Version
|
156
|
-
version:
|
144
|
+
version: 1.0.1
|
157
145
|
- !ruby/object:Gem::Dependency
|
158
146
|
name: gem-release
|
159
147
|
requirement: !ruby/object:Gem::Requirement
|
160
148
|
requirements:
|
161
149
|
- - "~>"
|
162
150
|
- !ruby/object:Gem::Version
|
163
|
-
version:
|
151
|
+
version: 2.1.1
|
164
152
|
type: :development
|
165
153
|
prerelease: false
|
166
154
|
version_requirements: !ruby/object:Gem::Requirement
|
167
155
|
requirements:
|
168
156
|
- - "~>"
|
169
157
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
158
|
+
version: 2.1.1
|
171
159
|
- !ruby/object:Gem::Dependency
|
172
160
|
name: guard
|
173
161
|
requirement: !ruby/object:Gem::Requirement
|
174
162
|
requirements:
|
175
163
|
- - "~>"
|
176
164
|
- !ruby/object:Gem::Version
|
177
|
-
version:
|
165
|
+
version: 2.16.2
|
178
166
|
type: :development
|
179
167
|
prerelease: false
|
180
168
|
version_requirements: !ruby/object:Gem::Requirement
|
181
169
|
requirements:
|
182
170
|
- - "~>"
|
183
171
|
- !ruby/object:Gem::Version
|
184
|
-
version:
|
172
|
+
version: 2.16.2
|
185
173
|
- !ruby/object:Gem::Dependency
|
186
174
|
name: guard-rspec
|
187
175
|
requirement: !ruby/object:Gem::Requirement
|
188
176
|
requirements:
|
189
177
|
- - "~>"
|
190
178
|
- !ruby/object:Gem::Version
|
191
|
-
version:
|
179
|
+
version: 4.7.3
|
192
180
|
type: :development
|
193
181
|
prerelease: false
|
194
182
|
version_requirements: !ruby/object:Gem::Requirement
|
195
183
|
requirements:
|
196
184
|
- - "~>"
|
197
185
|
- !ruby/object:Gem::Version
|
198
|
-
version:
|
186
|
+
version: 4.7.3
|
199
187
|
- !ruby/object:Gem::Dependency
|
200
188
|
name: guard-rubocop
|
201
189
|
requirement: !ruby/object:Gem::Requirement
|
202
190
|
requirements:
|
203
191
|
- - "~>"
|
204
192
|
- !ruby/object:Gem::Version
|
205
|
-
version: '1.
|
193
|
+
version: '1.3'
|
206
194
|
type: :development
|
207
195
|
prerelease: false
|
208
196
|
version_requirements: !ruby/object:Gem::Requirement
|
209
197
|
requirements:
|
210
198
|
- - "~>"
|
211
199
|
- !ruby/object:Gem::Version
|
212
|
-
version: '1.
|
200
|
+
version: '1.3'
|
213
201
|
- !ruby/object:Gem::Dependency
|
214
202
|
name: rake
|
215
203
|
requirement: !ruby/object:Gem::Requirement
|
216
204
|
requirements:
|
217
205
|
- - "~>"
|
218
206
|
- !ruby/object:Gem::Version
|
219
|
-
version:
|
207
|
+
version: 13.0.1
|
220
208
|
type: :development
|
221
209
|
prerelease: false
|
222
210
|
version_requirements: !ruby/object:Gem::Requirement
|
223
211
|
requirements:
|
224
212
|
- - "~>"
|
225
213
|
- !ruby/object:Gem::Version
|
226
|
-
version:
|
214
|
+
version: 13.0.1
|
227
215
|
- !ruby/object:Gem::Dependency
|
228
216
|
name: rspec
|
229
217
|
requirement: !ruby/object:Gem::Requirement
|
230
218
|
requirements:
|
231
219
|
- - "~>"
|
232
220
|
- !ruby/object:Gem::Version
|
233
|
-
version:
|
221
|
+
version: 3.9.0
|
234
222
|
type: :development
|
235
223
|
prerelease: false
|
236
224
|
version_requirements: !ruby/object:Gem::Requirement
|
237
225
|
requirements:
|
238
226
|
- - "~>"
|
239
227
|
- !ruby/object:Gem::Version
|
240
|
-
version:
|
228
|
+
version: 3.9.0
|
241
229
|
- !ruby/object:Gem::Dependency
|
242
230
|
name: rubocop
|
243
231
|
requirement: !ruby/object:Gem::Requirement
|
244
232
|
requirements:
|
245
233
|
- - "~>"
|
246
234
|
- !ruby/object:Gem::Version
|
247
|
-
version: 0.
|
235
|
+
version: 0.86.0
|
248
236
|
type: :development
|
249
237
|
prerelease: false
|
250
238
|
version_requirements: !ruby/object:Gem::Requirement
|
251
239
|
requirements:
|
252
240
|
- - "~>"
|
253
241
|
- !ruby/object:Gem::Version
|
254
|
-
version: 0.
|
242
|
+
version: 0.86.0
|
255
243
|
- !ruby/object:Gem::Dependency
|
256
244
|
name: webmock
|
257
245
|
requirement: !ruby/object:Gem::Requirement
|
258
246
|
requirements:
|
259
247
|
- - "~>"
|
260
248
|
- !ruby/object:Gem::Version
|
261
|
-
version:
|
249
|
+
version: 3.8.3
|
262
250
|
type: :development
|
263
251
|
prerelease: false
|
264
252
|
version_requirements: !ruby/object:Gem::Requirement
|
265
253
|
requirements:
|
266
254
|
- - "~>"
|
267
255
|
- !ruby/object:Gem::Version
|
268
|
-
version:
|
256
|
+
version: 3.8.3
|
269
257
|
- !ruby/object:Gem::Dependency
|
270
258
|
name: listen
|
271
259
|
requirement: !ruby/object:Gem::Requirement
|
272
260
|
requirements:
|
273
261
|
- - '='
|
274
262
|
- !ruby/object:Gem::Version
|
275
|
-
version: 3.
|
263
|
+
version: 3.2.1
|
276
264
|
type: :development
|
277
265
|
prerelease: false
|
278
266
|
version_requirements: !ruby/object:Gem::Requirement
|
279
267
|
requirements:
|
280
268
|
- - '='
|
281
269
|
- !ruby/object:Gem::Version
|
282
|
-
version: 3.
|
270
|
+
version: 3.2.1
|
283
271
|
description: |2
|
284
272
|
Ruby translators to transform various metadata feeds into solr documents and
|
285
273
|
a command-line utility to access/utilize the gem's translators to harvest
|
@@ -290,6 +278,8 @@ email:
|
|
290
278
|
- kovarik@nsidc.org
|
291
279
|
- luis.lopezespinosa@colorado.edu
|
292
280
|
- stuart.reed@colorado.edu
|
281
|
+
- jcollins@nsidc.org
|
282
|
+
- scott.lewis@nsidc.org
|
293
283
|
executables:
|
294
284
|
- search_solr_tools
|
295
285
|
extensions: []
|
@@ -369,15 +359,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
369
359
|
requirements:
|
370
360
|
- - "~>"
|
371
361
|
- !ruby/object:Gem::Version
|
372
|
-
version:
|
362
|
+
version: 2.6.5
|
373
363
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
374
364
|
requirements:
|
375
365
|
- - ">="
|
376
366
|
- !ruby/object:Gem::Version
|
377
367
|
version: '0'
|
378
368
|
requirements: []
|
379
|
-
|
380
|
-
rubygems_version: 2.6.11
|
369
|
+
rubygems_version: 3.0.8
|
381
370
|
signing_key:
|
382
371
|
specification_version: 4
|
383
372
|
summary: Tools to harvest and manage various scientific dataset feeds in a Solr instance.
|