hydra-editor 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/hydra-editor/multiForm.js +1 -1
- data/app/helpers/concerns/records_helper_behavior.rb +0 -4
- data/app/views/records/_edit_field.html.erb +3 -3
- data/app/views/records/_form.html.erb +2 -2
- data/app/views/records/edit_fields/_default.html.erb +3 -3
- data/lib/hydra_editor/version.rb +1 -1
- data/spec/dummy/Gemfile +5 -1
- data/spec/dummy/Gemfile.lock +42 -41
- data/spec/dummy/app/controllers/catalog_controller.rb +44 -49
- data/spec/dummy/app/views/devise/registrations/edit.html.erb +1 -1
- data/spec/dummy/config/application.rb +6 -0
- data/spec/dummy/config/initializers/devise.rb +11 -5
- data/spec/dummy/config/initializers/hydra_config.rb +1 -1
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/{20130415215624_devise_create_users.rb → 20130618142846_devise_create_users.rb} +0 -0
- data/spec/dummy/db/migrate/{20130415215633_create_searches.rb → 20130618142855_create_searches.rb} +0 -0
- data/spec/dummy/db/migrate/{20130415215634_create_bookmarks.rb → 20130618142856_create_bookmarks.rb} +0 -0
- data/spec/dummy/db/migrate/{20130415215635_remove_editable_fields_from_bookmarks.rb → 20130618142857_remove_editable_fields_from_bookmarks.rb} +0 -0
- data/spec/dummy/db/migrate/{20130415215636_add_user_types_to_bookmarks_searches.rb → 20130618142858_add_user_types_to_bookmarks_searches.rb} +0 -0
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +40 -40
- data/spec/dummy/log/test.log +42 -2295
- data/spec/dummy/solr_conf/conf/schema.xml +1 -161
- data/spec/dummy/solr_conf/conf/solrconfig.xml +16 -7
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57400fbf76b376d6d1d5e2ab6eed3f0669faa2c2
|
4
|
+
data.tar.gz: fe67f54e3baba3b681b76b20a8a0f4eccf861ca5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bba897d6015ce54013e9c81a0c5a6db3fe16d3fc9ddf59e4d90dd67c2c99f1fd98e8c6d369b881408f876a4d103e1b8ddb081c77bcbcc102e42751aa44d3b09
|
7
|
+
data.tar.gz: 657a910594d85f3f671f08641ae05f411f0e7de845148736ec2e67a2e23d8d1081870024bd521480a7d2d6e4cad770723bd2d429d5d982236fd16445e7ed5c6c
|
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
//clear out the value for the element being appended
|
23
23
|
//so the new element has a blank value
|
24
|
-
cloneElem.find('input[type=text]').
|
24
|
+
cloneElem.find('input[type=text]').val("");
|
25
25
|
cloneElem.find('input[type=text]').attr("required", false);
|
26
26
|
|
27
27
|
if (settings.afterAdd) {
|
@@ -24,10 +24,6 @@ module RecordsHelperBehavior
|
|
24
24
|
render_edit_field_partial_with_action('records', key, locals)
|
25
25
|
end
|
26
26
|
|
27
|
-
def render_batch_edit_field_partial(key, locals)
|
28
|
-
render_edit_field_partial_with_action('batch_edit', key, locals)
|
29
|
-
end
|
30
|
-
|
31
27
|
def add_field (key)
|
32
28
|
more_or_less_button(key, 'adder', '+')
|
33
29
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% render_req ||= true # render_req is true for single file edit, false for batch edit%>
|
2
2
|
<div class="control-group">
|
3
|
-
<% vals =
|
4
|
-
<% if render_req &&
|
3
|
+
<% vals = f.object[key] %>
|
4
|
+
<% if render_req && f.object.required?(key) %>
|
5
5
|
<% tmp = '<span class="error">*</span>' + field_label(key) %>
|
6
6
|
<%= f.label key, tmp.html_safe, :class=>"control-label" %>
|
7
7
|
<% else %>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<% end %>
|
10
10
|
|
11
11
|
<% vals.to_ary.each_with_index do |v, index| %>
|
12
|
-
<%= render_edit_field_partial(key,
|
12
|
+
<%= render_edit_field_partial(key, f:f, v: v, index: index, render_req: render_req) %>
|
13
13
|
<% end %>
|
14
14
|
</div><!-- /control-group -->
|
15
15
|
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<div id="descriptions_display">
|
3
3
|
<h2 class="non lower">Descriptions <small class="pull-right"><span class="error">*</span> indicates required fields</small> </h2>
|
4
4
|
<div class="well">
|
5
|
-
<%
|
6
|
-
<%= render :partial => "records/edit_field", :locals => {
|
5
|
+
<% f.object.terms_for_editing.each do |term| %>
|
6
|
+
<%= render :partial => "records/edit_field", :locals => {:f =>f, :render_req => true, :key => term } %>
|
7
7
|
<% end %>
|
8
8
|
</div><!-- /well -->
|
9
9
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div class="controls" <% if index == 0 %> id="additional_<%= key.to_s %>_clone" <% end %>>
|
2
|
-
<% required = render_req && (index == 0) &&
|
3
|
-
<%= text_field_tag "#{
|
4
|
-
<% unless
|
2
|
+
<% required = render_req && (index == 0) && f.object.required?(key) %>
|
3
|
+
<%= text_field_tag "#{f.object.class.model_name.underscore}[#{key.to_s}][]", v, :id => "#{f.object.class.model_name.underscore}_#{key.to_s}", :class => "input-large", :required => required %>
|
4
|
+
<% unless f.object.class.unique?(key) %>
|
5
5
|
<%= render :partial=>"records/edit_fields/suffix", :locals=>{key: key, index: index} %>
|
6
6
|
<% end %>
|
7
7
|
</div>
|
data/lib/hydra_editor/version.rb
CHANGED
data/spec/dummy/Gemfile
CHANGED
data/spec/dummy/Gemfile.lock
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../../
|
3
3
|
specs:
|
4
|
-
hydra-editor (0.0.
|
4
|
+
hydra-editor (0.0.2)
|
5
|
+
active-fedora (>= 6.3.0)
|
6
|
+
bootstrap_forms
|
5
7
|
rails (~> 3.2.13)
|
6
8
|
|
7
9
|
GEM
|
@@ -20,18 +22,16 @@ GEM
|
|
20
22
|
rack-cache (~> 1.2)
|
21
23
|
rack-test (~> 0.6.1)
|
22
24
|
sprockets (~> 2.2.1)
|
23
|
-
active-fedora (6.
|
24
|
-
activeresource (>= 3.0.0)
|
25
|
+
active-fedora (6.3.0)
|
25
26
|
activesupport (>= 3.0.0)
|
26
|
-
builder (~> 3.0.0)
|
27
27
|
deprecation
|
28
28
|
mediashelf-loggable
|
29
29
|
nom-xml (>= 0.5.1)
|
30
|
-
om (~> 2.
|
30
|
+
om (~> 2.1.0)
|
31
31
|
rdf
|
32
32
|
rdf-rdfxml (~> 1.0.0)
|
33
33
|
rsolr
|
34
|
-
rubydora (~> 1.5)
|
34
|
+
rubydora (~> 1.6, >= 1.6.5)
|
35
35
|
activemodel (3.2.13)
|
36
36
|
activesupport (= 3.2.13)
|
37
37
|
builder (~> 3.0.0)
|
@@ -48,10 +48,9 @@ GEM
|
|
48
48
|
multi_json (~> 1.0)
|
49
49
|
addressable (2.3.4)
|
50
50
|
arel (3.0.2)
|
51
|
-
backports (3.3.0)
|
52
51
|
bcrypt-ruby (3.0.1)
|
53
|
-
blacklight (4.2.
|
54
|
-
bootstrap-sass (
|
52
|
+
blacklight (4.2.1)
|
53
|
+
bootstrap-sass (>= 2.2.0, < 2.4)
|
55
54
|
kaminari (~> 0.13)
|
56
55
|
marc (>= 0.4.3, < 1.1)
|
57
56
|
nokogiri (~> 1.5)
|
@@ -60,23 +59,24 @@ GEM
|
|
60
59
|
sass-rails
|
61
60
|
block_helpers (0.3.3)
|
62
61
|
activesupport (>= 2.0)
|
63
|
-
bootstrap-sass (2.
|
62
|
+
bootstrap-sass (2.3.2.0)
|
64
63
|
sass (~> 3.2)
|
64
|
+
bootstrap_forms (3.0.1)
|
65
65
|
builder (3.0.4)
|
66
|
-
cancan (1.6.
|
66
|
+
cancan (1.6.10)
|
67
67
|
childprocess (0.3.9)
|
68
68
|
ffi (~> 1.0, >= 1.0.11)
|
69
69
|
daemons (1.1.9)
|
70
70
|
deprecation (0.0.5)
|
71
71
|
activesupport
|
72
|
-
devise (2.2.
|
72
|
+
devise (2.2.4)
|
73
73
|
bcrypt-ruby (~> 3.0)
|
74
74
|
orm_adapter (~> 0.1)
|
75
75
|
railties (~> 3.1)
|
76
76
|
warden (~> 1.2.1)
|
77
77
|
devise-guests (0.3.1)
|
78
78
|
devise
|
79
|
-
diff-lcs (1.2.
|
79
|
+
diff-lcs (1.2.4)
|
80
80
|
equivalent-xml (0.3.0)
|
81
81
|
nokogiri (>= 1.4.3)
|
82
82
|
erubis (2.7.0)
|
@@ -86,26 +86,26 @@ GEM
|
|
86
86
|
factory_girl (~> 4.2.0)
|
87
87
|
railties (>= 3.0.0)
|
88
88
|
fastercsv (1.5.5)
|
89
|
-
ffi (1.
|
90
|
-
hike (1.2.
|
91
|
-
hooks (0.
|
92
|
-
hydra-access-controls (6.
|
93
|
-
active-fedora (
|
89
|
+
ffi (1.9.0)
|
90
|
+
hike (1.2.3)
|
91
|
+
hooks (0.3.1)
|
92
|
+
hydra-access-controls (6.2.2)
|
93
|
+
active-fedora (~> 6.1)
|
94
94
|
activesupport
|
95
95
|
blacklight
|
96
96
|
cancan
|
97
97
|
deprecation
|
98
|
-
hydra-core (6.
|
98
|
+
hydra-core (6.2.2)
|
99
99
|
active-fedora
|
100
100
|
blacklight (~> 4.0)
|
101
101
|
block_helpers
|
102
102
|
deprecation (>= 0.0.5)
|
103
|
-
hydra-access-controls (= 6.
|
103
|
+
hydra-access-controls (= 6.2.2)
|
104
104
|
jettywrapper (>= 1.4.1)
|
105
105
|
rails (~> 3.2.3)
|
106
|
-
hydra-head (6.
|
107
|
-
hydra-access-controls (= 6.
|
108
|
-
hydra-core (= 6.
|
106
|
+
hydra-head (6.2.2)
|
107
|
+
hydra-access-controls (= 6.2.2)
|
108
|
+
hydra-core (= 6.2.2)
|
109
109
|
rails (>= 3.2.6)
|
110
110
|
i18n (0.6.1)
|
111
111
|
jettywrapper (1.4.1)
|
@@ -115,31 +115,32 @@ GEM
|
|
115
115
|
logger
|
116
116
|
mediashelf-loggable
|
117
117
|
journey (1.0.4)
|
118
|
-
json (1.
|
118
|
+
json (1.8.0)
|
119
119
|
kaminari (0.14.1)
|
120
120
|
actionpack (>= 3.0.0)
|
121
121
|
activesupport (>= 3.0.0)
|
122
122
|
logger (1.2.8)
|
123
|
-
mail (2.5.
|
124
|
-
i18n (>= 0.4.0)
|
123
|
+
mail (2.5.4)
|
125
124
|
mime-types (~> 1.16)
|
126
125
|
treetop (~> 1.4.8)
|
127
126
|
marc (0.5.0)
|
128
127
|
mediashelf-loggable (0.4.9)
|
129
|
-
mime-types (1.
|
130
|
-
|
131
|
-
|
128
|
+
mime-types (1.23)
|
129
|
+
mini_portile (0.5.0)
|
130
|
+
multi_json (1.7.7)
|
131
|
+
nokogiri (1.6.0)
|
132
|
+
mini_portile (~> 0.5.0)
|
132
133
|
nom-xml (0.5.1)
|
133
134
|
activesupport
|
134
135
|
i18n
|
135
136
|
nokogiri
|
136
|
-
om (2.
|
137
|
+
om (2.1.2)
|
137
138
|
activemodel
|
138
139
|
activesupport
|
139
140
|
deprecation
|
140
141
|
mediashelf-loggable
|
141
142
|
nokogiri (>= 1.4.2)
|
142
|
-
solrizer (~> 3.
|
143
|
+
solrizer (~> 3.1.0)
|
143
144
|
orm_adapter (0.4.0)
|
144
145
|
polyglot (0.3.3)
|
145
146
|
rack (1.4.5)
|
@@ -165,13 +166,12 @@ GEM
|
|
165
166
|
rdoc (~> 3.4)
|
166
167
|
thor (>= 0.14.6, < 2.0)
|
167
168
|
rake (10.0.4)
|
168
|
-
rdf (1.0.
|
169
|
+
rdf (1.0.7)
|
169
170
|
addressable (>= 2.2)
|
170
171
|
rdf-rdfxml (1.0.1)
|
171
172
|
rdf (>= 1.0)
|
172
173
|
rdf-xsd (>= 1.0)
|
173
|
-
rdf-xsd (1.0.
|
174
|
-
backports
|
174
|
+
rdf-xsd (1.0.2.1)
|
175
175
|
nokogiri (>= 1.5.0)
|
176
176
|
rdf (>= 0.3.4)
|
177
177
|
rdoc (3.12.2)
|
@@ -184,29 +184,29 @@ GEM
|
|
184
184
|
rspec-expectations (2.13.0)
|
185
185
|
diff-lcs (>= 1.1.3, < 2.0)
|
186
186
|
rspec-mocks (2.13.1)
|
187
|
-
rspec-rails (2.13.
|
187
|
+
rspec-rails (2.13.2)
|
188
188
|
actionpack (>= 3.0)
|
189
189
|
activesupport (>= 3.0)
|
190
190
|
railties (>= 3.0)
|
191
191
|
rspec-core (~> 2.13.0)
|
192
192
|
rspec-expectations (~> 2.13.0)
|
193
193
|
rspec-mocks (~> 2.13.0)
|
194
|
-
rubydora (1.6.
|
194
|
+
rubydora (1.6.5)
|
195
195
|
activemodel
|
196
196
|
activesupport
|
197
197
|
deprecation
|
198
198
|
equivalent-xml
|
199
199
|
fastercsv
|
200
|
-
hooks
|
200
|
+
hooks (~> 0.3.0)
|
201
201
|
mime-types
|
202
202
|
nokogiri
|
203
203
|
rest-client
|
204
|
-
sass (3.2.
|
204
|
+
sass (3.2.9)
|
205
205
|
sass-rails (3.2.6)
|
206
206
|
railties (~> 3.2.0)
|
207
207
|
sass (>= 3.1.10)
|
208
208
|
tilt (~> 1.3)
|
209
|
-
solrizer (3.
|
209
|
+
solrizer (3.1.0)
|
210
210
|
activesupport
|
211
211
|
daemons
|
212
212
|
mediashelf-loggable (~> 0.4.7)
|
@@ -221,8 +221,8 @@ GEM
|
|
221
221
|
sqlite3 (1.3.7)
|
222
222
|
stomp (1.2.9)
|
223
223
|
thor (0.18.1)
|
224
|
-
tilt (1.
|
225
|
-
treetop (1.4.
|
224
|
+
tilt (1.4.1)
|
225
|
+
treetop (1.4.14)
|
226
226
|
polyglot
|
227
227
|
polyglot (>= 0.3.1)
|
228
228
|
tzinfo (0.3.37)
|
@@ -241,6 +241,7 @@ DEPENDENCIES
|
|
241
241
|
factory_girl_rails
|
242
242
|
hydra-editor!
|
243
243
|
hydra-head
|
244
|
+
jettywrapper
|
244
245
|
rails (= 3.2.13)
|
245
246
|
rspec-rails
|
246
247
|
sqlite3
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
require 'blacklight/catalog'
|
3
3
|
|
4
|
-
class CatalogController < ApplicationController
|
4
|
+
class CatalogController < ApplicationController
|
5
5
|
|
6
6
|
include Blacklight::Catalog
|
7
7
|
include Hydra::Controller::ControllerBehavior
|
@@ -14,14 +14,14 @@ class CatalogController < ApplicationController
|
|
14
14
|
|
15
15
|
|
16
16
|
configure_blacklight do |config|
|
17
|
-
config.default_solr_params = {
|
17
|
+
config.default_solr_params = {
|
18
18
|
:qt => 'search',
|
19
|
-
:rows => 10
|
19
|
+
:rows => 10
|
20
20
|
}
|
21
21
|
|
22
22
|
# solr field configuration for search results/index views
|
23
23
|
config.index.show_link = 'title_tesim'
|
24
|
-
config.index.
|
24
|
+
config.index.record_display_type = 'has_model_ssim'
|
25
25
|
|
26
26
|
# solr field configuration for document/show views
|
27
27
|
config.show.html_title = 'title_tesim'
|
@@ -35,25 +35,25 @@ class CatalogController < ApplicationController
|
|
35
35
|
# * If left unset, then all facet values returned by solr will be displayed.
|
36
36
|
# * If set to an integer, then "f.somefield.facet.limit" will be added to
|
37
37
|
# solr request, with actual solr request being +1 your configured limit --
|
38
|
-
# you configure the number of items you actually want _tsimed_ in a page.
|
38
|
+
# you configure the number of items you actually want _tsimed_ in a page.
|
39
39
|
# * If set to 'true', then no additional parameters will be sent to solr,
|
40
40
|
# but any 'sniffed' request limit parameters will be used for paging, with
|
41
|
-
# paging at requested limit -1. Can sniff from facet.limit or
|
41
|
+
# paging at requested limit -1. Can sniff from facet.limit or
|
42
42
|
# f.specific_field.facet.limit solr request params. This 'true' config
|
43
43
|
# can be used if you set limits in :default_solr_params, or as defaults
|
44
44
|
# on the solr side in the request handler itself. Request handler defaults
|
45
45
|
# sniffing requires solr requests to be made with "echoParams=all", for
|
46
|
-
# app code to actually have it echo'd back to see it.
|
46
|
+
# app code to actually have it echo'd back to see it.
|
47
47
|
#
|
48
|
-
# :show may be set to false if you don't want the facet to be drawn in the
|
48
|
+
# :show may be set to false if you don't want the facet to be drawn in the
|
49
49
|
# facet bar
|
50
|
-
config.add_facet_field solr_name('object_type', :facetable), :label => 'Format'
|
51
|
-
config.add_facet_field solr_name('pub_date', :facetable), :label => 'Publication Year'
|
52
|
-
config.add_facet_field solr_name('subject_topic', :facetable), :label => 'Topic', :limit => 20
|
53
|
-
config.add_facet_field solr_name('language', :facetable), :label => 'Language', :limit => true
|
54
|
-
config.add_facet_field solr_name('lc1_letter', :facetable), :label => 'Call Number'
|
55
|
-
config.add_facet_field solr_name('subject_geo', :facetable), :label => 'Region'
|
56
|
-
config.add_facet_field solr_name('subject_era', :facetable), :label => 'Era'
|
50
|
+
config.add_facet_field solr_name('object_type', :facetable), :label => 'Format'
|
51
|
+
config.add_facet_field solr_name('pub_date', :facetable), :label => 'Publication Year'
|
52
|
+
config.add_facet_field solr_name('subject_topic', :facetable), :label => 'Topic', :limit => 20
|
53
|
+
config.add_facet_field solr_name('language', :facetable), :label => 'Language', :limit => true
|
54
|
+
config.add_facet_field solr_name('lc1_letter', :facetable), :label => 'Call Number'
|
55
|
+
config.add_facet_field solr_name('subject_geo', :facetable), :label => 'Region'
|
56
|
+
config.add_facet_field solr_name('subject_era', :facetable), :label => 'Era'
|
57
57
|
|
58
58
|
# Have BL send all facet field names to Solr, which has been the default
|
59
59
|
# previously. Simply remove these lines if you'd rather use Solr request
|
@@ -64,26 +64,26 @@ class CatalogController < ApplicationController
|
|
64
64
|
|
65
65
|
|
66
66
|
# solr fields to be displayed in the index (search results) view
|
67
|
-
# The ordering of the field names is the order of the display
|
68
|
-
config.add_index_field solr_name('title', :stored_searchable, type: :string), :label => 'Title:'
|
69
|
-
config.add_index_field solr_name('title_vern', :stored_searchable, type: :string), :label => 'Title:'
|
70
|
-
config.add_index_field solr_name('author', :stored_searchable, type: :string), :label => 'Author:'
|
71
|
-
config.add_index_field solr_name('author_vern', :stored_searchable, type: :string), :label => 'Author:'
|
72
|
-
config.add_index_field solr_name('format', :symbol), :label => 'Format:'
|
67
|
+
# The ordering of the field names is the order of the display
|
68
|
+
config.add_index_field solr_name('title', :stored_searchable, type: :string), :label => 'Title:'
|
69
|
+
config.add_index_field solr_name('title_vern', :stored_searchable, type: :string), :label => 'Title:'
|
70
|
+
config.add_index_field solr_name('author', :stored_searchable, type: :string), :label => 'Author:'
|
71
|
+
config.add_index_field solr_name('author_vern', :stored_searchable, type: :string), :label => 'Author:'
|
72
|
+
config.add_index_field solr_name('format', :symbol), :label => 'Format:'
|
73
73
|
config.add_index_field solr_name('language', :stored_searchable, type: :string), :label => 'Language:'
|
74
74
|
config.add_index_field solr_name('published', :stored_searchable, type: :string), :label => 'Published:'
|
75
75
|
config.add_index_field solr_name('published_vern', :stored_searchable, type: :string), :label => 'Published:'
|
76
76
|
config.add_index_field solr_name('lc_callnum', :stored_searchable, type: :string), :label => 'Call number:'
|
77
77
|
|
78
78
|
# solr fields to be displayed in the show (single result) view
|
79
|
-
# The ordering of the field names is the order of the display
|
80
|
-
config.add_show_field solr_name('title', :stored_searchable, type: :string), :label => 'Title:'
|
81
|
-
config.add_show_field solr_name('title_vern', :stored_searchable, type: :string), :label => 'Title:'
|
82
|
-
config.add_show_field solr_name('subtitle', :stored_searchable, type: :string), :label => 'Subtitle:'
|
83
|
-
config.add_show_field solr_name('subtitle_vern', :stored_searchable, type: :string), :label => 'Subtitle:'
|
84
|
-
config.add_show_field solr_name('author', :stored_searchable, type: :string), :label => 'Author:'
|
85
|
-
config.add_show_field solr_name('author_vern', :stored_searchable, type: :string), :label => 'Author:'
|
86
|
-
config.add_show_field solr_name('format', :symbol), :label => 'Format:'
|
79
|
+
# The ordering of the field names is the order of the display
|
80
|
+
config.add_show_field solr_name('title', :stored_searchable, type: :string), :label => 'Title:'
|
81
|
+
config.add_show_field solr_name('title_vern', :stored_searchable, type: :string), :label => 'Title:'
|
82
|
+
config.add_show_field solr_name('subtitle', :stored_searchable, type: :string), :label => 'Subtitle:'
|
83
|
+
config.add_show_field solr_name('subtitle_vern', :stored_searchable, type: :string), :label => 'Subtitle:'
|
84
|
+
config.add_show_field solr_name('author', :stored_searchable, type: :string), :label => 'Author:'
|
85
|
+
config.add_show_field solr_name('author_vern', :stored_searchable, type: :string), :label => 'Author:'
|
86
|
+
config.add_show_field solr_name('format', :symbol), :label => 'Format:'
|
87
87
|
config.add_show_field solr_name('url_fulltext_tsim', :stored_searchable, type: :string), :label => 'URL:'
|
88
88
|
config.add_show_field solr_name('url_suppl_tsim', :stored_searchable, type: :string), :label => 'More Information:'
|
89
89
|
config.add_show_field solr_name('language', :stored_searchable, type: :string), :label => 'Language:'
|
@@ -104,48 +104,43 @@ class CatalogController < ApplicationController
|
|
104
104
|
# The :key is what will be used to identify this BL search field internally,
|
105
105
|
# as well as in URLs -- so changing it after deployment may break bookmarked
|
106
106
|
# urls. A display label will be automatically calculated from the :key,
|
107
|
-
# or can be specified manually to be different.
|
107
|
+
# or can be specified manually to be different.
|
108
108
|
|
109
109
|
# This one uses all the defaults set by the solr request handler. Which
|
110
110
|
# solr request handler? The one set in config[:default_solr_parameters][:qt],
|
111
|
-
# since we aren't specifying it otherwise.
|
112
|
-
|
111
|
+
# since we aren't specifying it otherwise.
|
112
|
+
|
113
113
|
config.add_search_field 'all_fields', :label => 'All Fields'
|
114
|
-
|
114
|
+
|
115
115
|
|
116
116
|
# Now we see how to over-ride Solr request handler defaults, in this
|
117
117
|
# case for a BL "search field", which is really a dismax aggregate
|
118
|
-
# of Solr search fields.
|
119
|
-
|
120
|
-
config.add_search_field('title') do |field|
|
121
|
-
# solr_parameters hash are sent to Solr as ordinary url query params.
|
122
|
-
field.solr_parameters = { :'spellcheck.dictionary' => 'title' }
|
118
|
+
# of Solr search fields.
|
123
119
|
|
120
|
+
config.add_search_field('title') do |field|
|
124
121
|
# :solr_local_parameters will be sent using Solr LocalParams
|
125
122
|
# syntax, as eg {! qf=$title_qf }. This is neccesary to use
|
126
123
|
# Solr parameter de-referencing like $title_qf.
|
127
124
|
# See: http://wiki.apache.org/solr/LocalParams
|
128
|
-
field.solr_local_parameters = {
|
125
|
+
field.solr_local_parameters = {
|
129
126
|
:qf => '$title_qf',
|
130
127
|
:pf => '$title_pf'
|
131
128
|
}
|
132
129
|
end
|
133
|
-
|
130
|
+
|
134
131
|
config.add_search_field('author') do |field|
|
135
|
-
field.
|
136
|
-
field.solr_local_parameters = {
|
132
|
+
field.solr_local_parameters = {
|
137
133
|
:qf => '$author_qf',
|
138
134
|
:pf => '$author_pf'
|
139
135
|
}
|
140
136
|
end
|
141
|
-
|
137
|
+
|
142
138
|
# Specifying a :qt only to show it's possible, and so our internal automated
|
143
|
-
# tests can test it. In this case it's the same as
|
144
|
-
# config[:default_solr_parameters][:qt], so isn't actually neccesary.
|
139
|
+
# tests can test it. In this case it's the same as
|
140
|
+
# config[:default_solr_parameters][:qt], so isn't actually neccesary.
|
145
141
|
config.add_search_field('subject') do |field|
|
146
|
-
field.solr_parameters = { :'spellcheck.dictionary' => 'subject' }
|
147
142
|
field.qt = 'search'
|
148
|
-
field.solr_local_parameters = {
|
143
|
+
field.solr_local_parameters = {
|
149
144
|
:qf => '$subject_qf',
|
150
145
|
:pf => '$subject_pf'
|
151
146
|
}
|
@@ -160,11 +155,11 @@ class CatalogController < ApplicationController
|
|
160
155
|
config.add_sort_field 'author_tesi asc, title_tesi asc', :label => 'author'
|
161
156
|
config.add_sort_field 'title_tesi asc, pub_date_dtsi desc', :label => 'title'
|
162
157
|
|
163
|
-
# If there are more than this many search results, no spelling ("did you
|
158
|
+
# If there are more than this many search results, no spelling ("did you
|
164
159
|
# mean") suggestion is offered.
|
165
160
|
config.spell_max = 5
|
166
161
|
end
|
167
162
|
|
168
163
|
|
169
164
|
|
170
|
-
end
|
165
|
+
end
|