solr_ead 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/.rvmrc +1 -48
- data/Gemfile.lock +79 -0
- data/lib/solr_ead/component.rb +36 -35
- data/lib/solr_ead/document.rb +32 -32
- data/lib/solr_ead/version.rb +1 -1
- data/solr_ead.gemspec +2 -2
- data/spec/component_spec.rb +26 -17
- metadata +11 -10
data/.gitignore
CHANGED
data/.rvmrc
CHANGED
@@ -1,48 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
-
# development environment upon cd'ing into the directory
|
5
|
-
|
6
|
-
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
|
-
# Only full ruby name is supported here, for short names use:
|
8
|
-
# echo "rvm use 1.9.3" > .rvmrc
|
9
|
-
environment_id="ruby-1.9.3-p125@solr_ead"
|
10
|
-
|
11
|
-
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
-
# rvmrc_rvm_version="1.14.3 (version)" # 1.10.1 seams as a safe start
|
13
|
-
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
-
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
-
# return 1
|
16
|
-
# }
|
17
|
-
|
18
|
-
# First we attempt to load the desired environment directly from the environment
|
19
|
-
# file. This is very fast and efficient compared to running through the entire
|
20
|
-
# CLI and selector. If you want feedback on which environment was used then
|
21
|
-
# insert the word 'use' after --create as this triggers verbose mode.
|
22
|
-
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
23
|
-
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
24
|
-
then
|
25
|
-
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
26
|
-
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
|
27
|
-
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
|
28
|
-
else
|
29
|
-
# If the environment file has not yet been created, use the RVM CLI to select.
|
30
|
-
rvm --create "$environment_id" || {
|
31
|
-
echo "Failed to create RVM environment '${environment_id}'."
|
32
|
-
return 1
|
33
|
-
}
|
34
|
-
fi
|
35
|
-
|
36
|
-
# If you use bundler, this might be useful to you:
|
37
|
-
# if [[ -s Gemfile ]] && {
|
38
|
-
# ! builtin command -v bundle >/dev/null ||
|
39
|
-
# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
|
40
|
-
# }
|
41
|
-
# then
|
42
|
-
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
43
|
-
# gem install bundler
|
44
|
-
# fi
|
45
|
-
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
46
|
-
# then
|
47
|
-
# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
|
48
|
-
# fi
|
1
|
+
rvm use ruby-1.9.3-p286@solr_ead --create
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
solr_ead (0.0.4)
|
5
|
+
om (~> 1.8.0)
|
6
|
+
rsolr
|
7
|
+
sanitize
|
8
|
+
solrizer (~> 2.0.0)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
activemodel (3.2.9)
|
14
|
+
activesupport (= 3.2.9)
|
15
|
+
builder (~> 3.0.0)
|
16
|
+
activesupport (3.2.9)
|
17
|
+
i18n (~> 0.6)
|
18
|
+
multi_json (~> 1.0)
|
19
|
+
builder (3.0.4)
|
20
|
+
columnize (0.3.6)
|
21
|
+
daemons (1.1.9)
|
22
|
+
debugger (1.2.2)
|
23
|
+
columnize (>= 0.3.1)
|
24
|
+
debugger-linecache (~> 1.1.1)
|
25
|
+
debugger-ruby_core_source (~> 1.1.5)
|
26
|
+
debugger-linecache (1.1.2)
|
27
|
+
debugger-ruby_core_source (>= 1.1.1)
|
28
|
+
debugger-ruby_core_source (1.1.5)
|
29
|
+
deprecation (0.0.5)
|
30
|
+
activesupport
|
31
|
+
diff-lcs (1.1.3)
|
32
|
+
i18n (0.6.1)
|
33
|
+
json (1.7.5)
|
34
|
+
mediashelf-loggable (0.4.9)
|
35
|
+
multi_json (1.4.0)
|
36
|
+
nokogiri (1.5.5)
|
37
|
+
om (1.8.0)
|
38
|
+
activemodel
|
39
|
+
activesupport
|
40
|
+
deprecation
|
41
|
+
mediashelf-loggable
|
42
|
+
nokogiri (>= 1.4.2)
|
43
|
+
rdoc (3.12)
|
44
|
+
json (~> 1.4)
|
45
|
+
redcarpet (2.2.2)
|
46
|
+
rsolr (1.0.8)
|
47
|
+
builder (>= 2.1.2)
|
48
|
+
rspec (2.12.0)
|
49
|
+
rspec-core (~> 2.12.0)
|
50
|
+
rspec-expectations (~> 2.12.0)
|
51
|
+
rspec-mocks (~> 2.12.0)
|
52
|
+
rspec-core (2.12.1)
|
53
|
+
rspec-expectations (2.12.0)
|
54
|
+
diff-lcs (~> 1.1.3)
|
55
|
+
rspec-mocks (2.12.0)
|
56
|
+
sanitize (2.0.3)
|
57
|
+
nokogiri (>= 1.4.4, < 1.6)
|
58
|
+
nokogiri (>= 1.4.4, < 1.6)
|
59
|
+
solrizer (2.0.0)
|
60
|
+
daemons
|
61
|
+
mediashelf-loggable (~> 0.4.7)
|
62
|
+
nokogiri
|
63
|
+
om (>= 1.5.0)
|
64
|
+
stomp
|
65
|
+
xml-simple
|
66
|
+
stomp (1.2.7)
|
67
|
+
xml-simple (1.1.2)
|
68
|
+
yard (0.8.3)
|
69
|
+
|
70
|
+
PLATFORMS
|
71
|
+
ruby
|
72
|
+
|
73
|
+
DEPENDENCIES
|
74
|
+
debugger
|
75
|
+
rdoc
|
76
|
+
redcarpet
|
77
|
+
rspec
|
78
|
+
solr_ead!
|
79
|
+
yard
|
data/lib/solr_ead/component.rb
CHANGED
@@ -5,8 +5,8 @@ class SolrEad::Component
|
|
5
5
|
|
6
6
|
# Define each term in your ead that you want put into the solr document
|
7
7
|
set_terminology do |t|
|
8
|
-
t.root(:path=>"c"
|
9
|
-
t.
|
8
|
+
t.root(:path=>"c")
|
9
|
+
t.ref_(:path=>"/c/@id", :index_as=>[:string])
|
10
10
|
t.level(:path=>"/c/@level", :index_as => [:facetable])
|
11
11
|
|
12
12
|
t.title(:path=>"unittitle", :attributes=>{ :type => :none }, :index_as=>[:searchable, :displayable])
|
@@ -21,10 +21,10 @@ class SolrEad::Component
|
|
21
21
|
t.subject(:index_as=>[:facetable])
|
22
22
|
|
23
23
|
# Archival material
|
24
|
-
t.container(:attributes=>{ :type => "Box" }
|
25
|
-
t.label(:path=>{ :attribute=>"label" }
|
24
|
+
t.container(:attributes=>{ :type => "Box" }) {
|
25
|
+
t.label(:path=>{ :attribute=>"label" })
|
26
26
|
}
|
27
|
-
t.material(:proxy=>[:container, :label])
|
27
|
+
t.material(:proxy=>[:container, :label], :index_as => [:facetable])
|
28
28
|
|
29
29
|
# These terms are proxied to match with Blacklight's default facets, but otherwise
|
30
30
|
# you can remove them or rename the above facet terms to match with your solr
|
@@ -32,36 +32,36 @@ class SolrEad::Component
|
|
32
32
|
t.subject_geo(:proxy=>[:geogname])
|
33
33
|
t.subject_topic(:proxy=>[:subject])
|
34
34
|
|
35
|
-
t.accessrestrict(:path=>"accessrestrict/p")
|
36
|
-
t.accessrestrict_heading(:path=>"accessrestrict/head", :index_as=>[:
|
37
|
-
t.accruals(:path=>"accruals/p")
|
38
|
-
t.accruals_heading(:path=>"accruals/head", :index_as=>[:
|
39
|
-
t.acqinfo(:path=>"acqinfo/p")
|
40
|
-
t.acqinfo_heading(:path=>"acqinfo/head", :index_as=>[:
|
41
|
-
t.altformavail(:path=>"altformavail/p")
|
42
|
-
t.altformavail_heading(:path=>"altformavail/head", :index_as=>[:
|
43
|
-
t.appraisal(:path=>"appraisal/p")
|
44
|
-
t.appraisal_heading(:path=>"appraisal/head", :index_as=>[:
|
45
|
-
t.arrangement(:path=>"arrangement/p")
|
46
|
-
t.arrangement_heading(:path=>"arrangement/head", :index_as=>[:
|
47
|
-
t.custodhist(:path=>"custodhist/p")
|
48
|
-
t.custodhist_heading(:path=>"custodhist/head", :index_as=>[:
|
49
|
-
t.fileplan(:path=>"fileplan/p")
|
50
|
-
t.fileplan_heading(:path=>"fileplan/head", :index_as=>[:
|
51
|
-
t.originalsloc(:path=>"originalsloc/p")
|
52
|
-
t.originalsloc_heading(:path=>"originalsloc/head", :index_as=>[:
|
53
|
-
t.phystech(:path=>"phystech/p")
|
54
|
-
t.phystech_heading(:path=>"phystech/head", :index_as=>[:
|
55
|
-
t.processinfo(:path=>"processinfo/p")
|
56
|
-
t.processinfo_heading(:path=>"processinfo/head", :index_as=>[:
|
57
|
-
t.relatedmaterial(:path=>"relatedmaterial/p")
|
58
|
-
t.relatedmaterial_heading(:path=>"relatedmaterial/head", :index_as=>[:
|
59
|
-
t.separatedmaterial(:path=>"separatedmaterial/p")
|
60
|
-
t.separatedmaterial_heading(:path=>"separatedmaterial/head", :index_as=>[:
|
61
|
-
t.scopecontent(:path=>"scopecontent/p")
|
62
|
-
t.scopecontent_heading(:path=>"scopecontent/head", :index_as=>[:
|
63
|
-
t.userestrict(:path=>"userestrict/p")
|
64
|
-
t.userestrict_heading(:path=>"userestrict/head", :index_as=>[:
|
35
|
+
t.accessrestrict(:path=>"accessrestrict/p", :index_as=>[:searchable])
|
36
|
+
t.accessrestrict_heading(:path=>"accessrestrict/head", :index_as=>[:displayable])
|
37
|
+
t.accruals(:path=>"accruals/p", :index_as=>[:searchable])
|
38
|
+
t.accruals_heading(:path=>"accruals/head", :index_as=>[:displayable])
|
39
|
+
t.acqinfo(:path=>"acqinfo/p", :index_as=>[:searchable])
|
40
|
+
t.acqinfo_heading(:path=>"acqinfo/head", :index_as=>[:displayable])
|
41
|
+
t.altformavail(:path=>"altformavail/p", :index_as=>[:searchable])
|
42
|
+
t.altformavail_heading(:path=>"altformavail/head", :index_as=>[:displayable])
|
43
|
+
t.appraisal(:path=>"appraisal/p", :index_as=>[:searchable])
|
44
|
+
t.appraisal_heading(:path=>"appraisal/head", :index_as=>[:displayable])
|
45
|
+
t.arrangement(:path=>"arrangement/p", :index_as=>[:searchable])
|
46
|
+
t.arrangement_heading(:path=>"arrangement/head", :index_as=>[:displayable])
|
47
|
+
t.custodhist(:path=>"custodhist/p", :index_as=>[:searchable])
|
48
|
+
t.custodhist_heading(:path=>"custodhist/head", :index_as=>[:displayable])
|
49
|
+
t.fileplan(:path=>"fileplan/p", :index_as=>[:searchable])
|
50
|
+
t.fileplan_heading(:path=>"fileplan/head", :index_as=>[:displayable])
|
51
|
+
t.originalsloc(:path=>"originalsloc/p", :index_as=>[:searchable])
|
52
|
+
t.originalsloc_heading(:path=>"originalsloc/head", :index_as=>[:displayable])
|
53
|
+
t.phystech(:path=>"phystech/p", :index_as=>[:searchable])
|
54
|
+
t.phystech_heading(:path=>"phystech/head", :index_as=>[:displayable])
|
55
|
+
t.processinfo(:path=>"processinfo/p", :index_as=>[:searchable])
|
56
|
+
t.processinfo_heading(:path=>"processinfo/head", :index_as=>[:displayable])
|
57
|
+
t.relatedmaterial(:path=>"relatedmaterial/p", :index_as=>[:searchable])
|
58
|
+
t.relatedmaterial_heading(:path=>"relatedmaterial/head", :index_as=>[:displayable])
|
59
|
+
t.separatedmaterial(:path=>"separatedmaterial/p", :index_as=>[:searchable])
|
60
|
+
t.separatedmaterial_heading(:path=>"separatedmaterial/head", :index_as=>[:displayable])
|
61
|
+
t.scopecontent(:path=>"scopecontent/p", :index_as=>[:searchable])
|
62
|
+
t.scopecontent_heading(:path=>"scopecontent/head", :index_as=>[:displayable])
|
63
|
+
t.userestrict(:path=>"userestrict/p", :index_as=>[:searchable])
|
64
|
+
t.userestrict_heading(:path=>"userestrict/head", :index_as=>[:displayable])
|
65
65
|
|
66
66
|
end
|
67
67
|
|
@@ -69,6 +69,7 @@ class SolrEad::Component
|
|
69
69
|
super(solr_doc)
|
70
70
|
solr_doc.merge!({"format" => "Archival Item"})
|
71
71
|
solr_doc["parent_unittitles_display"].length > 0 ? solr_doc.merge!({"heading_display" => [ solr_doc["parent_unittitles_display"], self.title.first].join(" >> ") }) : solr_doc.merge!({"heading_display" => self.title.first })
|
72
|
+
solr_doc.merge!({"ref_s" => self.ref.first})
|
72
73
|
end
|
73
74
|
|
74
75
|
end
|
data/lib/solr_ead/document.rb
CHANGED
@@ -6,7 +6,7 @@ class SolrEad::Document
|
|
6
6
|
|
7
7
|
# Define each term in your ead that you want put into the solr document
|
8
8
|
set_terminology do |t|
|
9
|
-
t.root(:path=>"ead"
|
9
|
+
t.root(:path=>"ead")
|
10
10
|
|
11
11
|
t.eadid
|
12
12
|
t.corpname(:index_as=>[:facetable])
|
@@ -24,39 +24,39 @@ class SolrEad::Document
|
|
24
24
|
t.subject_topic(:proxy=>[:subject])
|
25
25
|
|
26
26
|
t.title(:path=>"titleproper", :attributes=>{ :type => :none }, :index_as=>[:searchable, :displayable])
|
27
|
-
t.title_filing(:path=>"titleproper", :attributes=>{ :type => "filing" }, :index_as=>[:
|
27
|
+
t.title_filing(:path=>"titleproper", :attributes=>{ :type => "filing" }, :index_as=>[:sortable])
|
28
28
|
|
29
29
|
# General field available within archdesc
|
30
|
-
t.accessrestrict(:path=>"archdesc/accessrestrict/p")
|
31
|
-
t.accessrestrict_heading(:path=>"archdesc/accessrestrict/head", :index_as=>[:
|
32
|
-
t.accruals(:path=>"archdesc/accruals/p")
|
33
|
-
t.accruals_heading(:path=>"archdesc/accruals/head", :index_as=>[:
|
34
|
-
t.acqinfo(:path=>"archdesc/acqinfo/p")
|
35
|
-
t.acqinfo_heading(:path=>"archdesc/acqinfo/head", :index_as=>[:
|
36
|
-
t.altformavail(:path=>"archdesc/altformavail/p")
|
37
|
-
t.altformavail_heading(:path=>"archdesc/altformavail/head", :index_as=>[:
|
38
|
-
t.appraisal(:path=>"archdesc/appraisal/p")
|
39
|
-
t.appraisal_heading(:path=>"archdesc/appraisal/head", :index_as=>[:
|
40
|
-
t.arrangement(:path=>"archdesc/arrangement/p")
|
41
|
-
t.arrangement_heading(:path=>"archdesc/arrangement/head", :index_as=>[:
|
42
|
-
t.custodhist(:path=>"archdesc/custodhist/p")
|
43
|
-
t.custodhist_heading(:path=>"archdesc/custodhist/head", :index_as=>[:
|
44
|
-
t.fileplan(:path=>"archdesc/fileplan/p")
|
45
|
-
t.fileplan_heading(:path=>"archdesc/fileplan/head", :index_as=>[:
|
46
|
-
t.originalsloc(:path=>"archdesc/originalsloc/p")
|
47
|
-
t.originalsloc_heading(:path=>"archdesc/originalsloc/head", :index_as=>[:
|
48
|
-
t.phystech(:path=>"archdesc/phystech/p")
|
49
|
-
t.phystech_heading(:path=>"archdesc/phystech/head", :index_as=>[:
|
50
|
-
t.processinfo(:path=>"archdesc/processinfo/p")
|
51
|
-
t.processinfo_heading(:path=>"archdesc/processinfo/head", :index_as=>[:
|
52
|
-
t.relatedmaterial(:path=>"archdesc/relatedmaterial/p")
|
53
|
-
t.relatedmaterial_heading(:path=>"archdesc/relatedmaterial/head", :index_as=>[:
|
54
|
-
t.separatedmaterial(:path=>"archdesc/separatedmaterial/p")
|
55
|
-
t.separatedmaterial_heading(:path=>"archdesc/separatedmaterial/head", :index_as=>[:
|
56
|
-
t.scopecontent(:path=>"archdesc/scopecontent/p")
|
57
|
-
t.scopecontent_heading(:path=>"archdesc/scopecontent/head", :index_as=>[:
|
58
|
-
t.userestrict(:path=>"archdesc/userestrict/p")
|
59
|
-
t.userestrict_heading(:path=>"archdesc/userestrict/head", :index_as=>[:
|
30
|
+
t.accessrestrict(:path=>"archdesc/accessrestrict/p", :index_as=>[:searchable])
|
31
|
+
t.accessrestrict_heading(:path=>"archdesc/accessrestrict/head", :index_as=>[:displayable])
|
32
|
+
t.accruals(:path=>"archdesc/accruals/p", :index_as=>[:searchable])
|
33
|
+
t.accruals_heading(:path=>"archdesc/accruals/head", :index_as=>[:displayable])
|
34
|
+
t.acqinfo(:path=>"archdesc/acqinfo/p", :index_as=>[:searchable])
|
35
|
+
t.acqinfo_heading(:path=>"archdesc/acqinfo/head", :index_as=>[:displayable])
|
36
|
+
t.altformavail(:path=>"archdesc/altformavail/p", :index_as=>[:searchable])
|
37
|
+
t.altformavail_heading(:path=>"archdesc/altformavail/head", :index_as=>[:displayable])
|
38
|
+
t.appraisal(:path=>"archdesc/appraisal/p", :index_as=>[:searchable])
|
39
|
+
t.appraisal_heading(:path=>"archdesc/appraisal/head", :index_as=>[:displayable])
|
40
|
+
t.arrangement(:path=>"archdesc/arrangement/p", :index_as=>[:searchable])
|
41
|
+
t.arrangement_heading(:path=>"archdesc/arrangement/head", :index_as=>[:displayable])
|
42
|
+
t.custodhist(:path=>"archdesc/custodhist/p", :index_as=>[:searchable])
|
43
|
+
t.custodhist_heading(:path=>"archdesc/custodhist/head", :index_as=>[:displayable])
|
44
|
+
t.fileplan(:path=>"archdesc/fileplan/p", :index_as=>[:searchable])
|
45
|
+
t.fileplan_heading(:path=>"archdesc/fileplan/head", :index_as=>[:displayable])
|
46
|
+
t.originalsloc(:path=>"archdesc/originalsloc/p", :index_as=>[:searchable])
|
47
|
+
t.originalsloc_heading(:path=>"archdesc/originalsloc/head", :index_as=>[:displayable])
|
48
|
+
t.phystech(:path=>"archdesc/phystech/p", :index_as=>[:searchable])
|
49
|
+
t.phystech_heading(:path=>"archdesc/phystech/head", :index_as=>[:displayable])
|
50
|
+
t.processinfo(:path=>"archdesc/processinfo/p", :index_as=>[:searchable])
|
51
|
+
t.processinfo_heading(:path=>"archdesc/processinfo/head", :index_as=>[:displayable])
|
52
|
+
t.relatedmaterial(:path=>"archdesc/relatedmaterial/p", :index_as=>[:searchable])
|
53
|
+
t.relatedmaterial_heading(:path=>"archdesc/relatedmaterial/head", :index_as=>[:displayable])
|
54
|
+
t.separatedmaterial(:path=>"archdesc/separatedmaterial/p", :index_as=>[:searchable])
|
55
|
+
t.separatedmaterial_heading(:path=>"archdesc/separatedmaterial/head", :index_as=>[:displayable])
|
56
|
+
t.scopecontent(:path=>"archdesc/scopecontent/p", :index_as=>[:searchable])
|
57
|
+
t.scopecontent_heading(:path=>"archdesc/scopecontent/head", :index_as=>[:displayable])
|
58
|
+
t.userestrict(:path=>"archdesc/userestrict/p", :index_as=>[:searchable])
|
59
|
+
t.userestrict_heading(:path=>"archdesc/userestrict/head", :index_as=>[:displayable])
|
60
60
|
|
61
61
|
end
|
62
62
|
|
data/lib/solr_ead/version.rb
CHANGED
data/solr_ead.gemspec
CHANGED
@@ -16,8 +16,8 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.version = SolrEad::VERSION
|
17
17
|
|
18
18
|
# Dependencies
|
19
|
-
gem.add_dependency('om')
|
20
|
-
gem.add_dependency('solrizer')
|
19
|
+
gem.add_dependency('om', '~> 1.8.0')
|
20
|
+
gem.add_dependency('solrizer', '~> 2.0.0')
|
21
21
|
gem.add_dependency('rsolr')
|
22
22
|
gem.add_dependency('sanitize')
|
23
23
|
gem.add_development_dependency('yard')
|
data/spec/component_spec.rb
CHANGED
@@ -9,21 +9,31 @@ describe SolrEad::Component do
|
|
9
9
|
|
10
10
|
describe "the solr document" do
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
12
|
+
describe "for item-level components" do
|
13
|
+
|
14
|
+
before :each do
|
15
|
+
additional_fields = {
|
16
|
+
"id" => "TEST-0001:ref010",
|
17
|
+
"eadid_s" => "TEST-0001",
|
18
|
+
"parent_id_s" => "ref001",
|
19
|
+
"parent_ids_display" => ["ref001", "ref002", "ref003"],
|
20
|
+
"parent_unittitles_display" => ["Series I", "Subseries A", "Subseries 1"],
|
21
|
+
"component_children_b" => FALSE
|
22
|
+
}
|
23
|
+
@solr_doc = @doc.to_solr(additional_fields)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should accept additional fields from a hash" do
|
27
|
+
@solr_doc["id"].should == "TEST-0001:ref010"
|
28
|
+
@solr_doc["level_facet"].should include "item"
|
29
|
+
@solr_doc["heading_display"].should == "Series I >> Subseries A >> Subseries 1 >> Internal Revenue Service Form Information Return [RESTRICTED]"
|
30
|
+
@solr_doc["accessrestrict_t"].first.should match /^This item .* is available.$/
|
31
|
+
@solr_doc["accessrestrict_heading_display"].should include "Access Restrictions"
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should create fields using type" do
|
35
|
+
@solr_doc["ref_s"].should == "ref215"
|
36
|
+
end
|
27
37
|
|
28
38
|
end
|
29
39
|
|
@@ -42,8 +52,7 @@ describe SolrEad::Component do
|
|
42
52
|
solr_doc["heading_display"].should == "Internal Revenue Service Form Information Return [RESTRICTED]"
|
43
53
|
solr_doc["accessrestrict_t"].first.should match /^This item .* is available.$/
|
44
54
|
solr_doc["accessrestrict_heading_display"].should include "Access Restrictions"
|
45
|
-
|
46
|
-
end
|
55
|
+
end
|
47
56
|
|
48
57
|
end
|
49
58
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solr_ead
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,40 +9,40 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: om
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 1.8.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 1.8.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: solrizer
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 2.0.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 2.0.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: rsolr
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -167,6 +167,7 @@ files:
|
|
167
167
|
- .gitignore
|
168
168
|
- .rvmrc
|
169
169
|
- Gemfile
|
170
|
+
- Gemfile.lock
|
170
171
|
- LICENSE
|
171
172
|
- README.md
|
172
173
|
- Rakefile
|