blacklight 6.11.2 → 6.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 445c850f8ead2b777654edd2de72f938cc4428d0
4
- data.tar.gz: 5f0eb1aff8ceeabe37f47b4bda0118834ab45819
3
+ metadata.gz: 02341df004a989772bead1f95c9d0cb9bbe2efb4
4
+ data.tar.gz: bfa578b3cbd743828afdbc9e261f0aaff917373e
5
5
  SHA512:
6
- metadata.gz: 0704b69f8407a748857c5becb09e53eda41cdd76fbfeea523b7e37b534841142dc8393fbc88ab0257710743cebf8ba45aafe23fe20c41d7ea3281dde3f26083b
7
- data.tar.gz: c5c17214fda7c4743bad2eca926b1a84d4aab9fc1d79c8e1c9dfe99d9b7e908b3d43104e4ebf417c6c8bac4d634f5dcc753d68156ec7b0442f10e232f90e2700
6
+ metadata.gz: 33942d3280a5ce4ab36703a0d81975ecc8e93a92ec44b3c824166ae0a738522bdd7a17f54fd77371449a3c386b4793d0e5dcfbdbd0542d0d25a283e9fe0a72b1
7
+ data.tar.gz: 24b2a2e23c5ec9e38c710ad3764a2e47a3a9ededd1d327842a47c0d1eb52777c92576e39b16d634ca08f74c471d01427460cb532784c92fc576d45f1f03614a5
@@ -92,6 +92,7 @@ Metrics/ClassLength:
92
92
  Exclude:
93
93
  - 'lib/blacklight/configuration.rb'
94
94
  - 'lib/blacklight/search_builder.rb'
95
+ - 'lib/blacklight/search_state.rb'
95
96
 
96
97
  # Offense count: 20
97
98
  Metrics/CyclomaticComplexity:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.11.2
1
+ 6.12.0
@@ -126,7 +126,7 @@ Blacklight.ajaxModal.receiveAjax = function (contents) {
126
126
  $(Blacklight.ajaxModal.modalSelector).find('.modal-content').html(contents);
127
127
 
128
128
  // send custom event with the modal dialog div as the target
129
- var e = $.Event('loaded.blacklight.blacklight-modal')
129
+ var e = $.Event('loaded.blacklight.ajax-modal');
130
130
  $(Blacklight.ajaxModal.modalSelector).trigger(e);
131
131
  // if they did preventDefault, don't show the dialog
132
132
  if (e.isDefaultPrevented()) return;
@@ -56,13 +56,17 @@ module Blacklight
56
56
  flash[:success] ||= I18n.t("blacklight.#{name}.success", default: nil)
57
57
 
58
58
  respond_to do |format|
59
- format.html { redirect_to action_success_redirect_path }
60
- format.js { render "#{name}_success" }
59
+ format.html do
60
+ return render "#{name}_success", layout: false if request.xhr?
61
+ redirect_to action_success_redirect_path
62
+ end
61
63
  end
62
64
  else
63
65
  respond_to do |format|
64
- format.html
65
- format.js { render :layout => false }
66
+ format.html do
67
+ return render layout: false if request.xhr?
68
+ # Otherwise draw the full page
69
+ end
66
70
  end
67
71
  end
68
72
  end
@@ -114,7 +114,15 @@ module Blacklight
114
114
  # from the session will get remove in the show view...
115
115
  p[:f] = (p[:f] || {}).dup
116
116
  p[:f][url_field] = (p[:f][url_field] || []).dup
117
- p[:f][url_field] = p[:f][url_field] - [value]
117
+
118
+ collection = p[:f][url_field]
119
+ # collection should be an array, because we link to ?f[key][]=value,
120
+ # however, Facebook (and maybe some other PHP tools) tranform that parameters
121
+ # into ?f[key][0]=value, which Rails interprets as a Hash.
122
+ if collection.is_a? Hash
123
+ collection = collection.values
124
+ end
125
+ p[:f][url_field] = collection - [value]
118
126
  p[:f].delete(url_field) if p[:f][url_field].empty?
119
127
  p.delete(:f) if p[:f].empty?
120
128
  p
@@ -16,10 +16,10 @@
16
16
  limitations under the License.
17
17
  -->
18
18
 
19
- <!--
19
+ <!--
20
20
  This is the Solr schema file. This file should be named "schema.xml" and
21
21
  should be in the conf directory under the solr home
22
- (i.e. ./solr/conf/schema.xml by default)
22
+ (i.e. ./solr/conf/schema.xml by default)
23
23
  or located where the classloader for the Solr webapp can find it.
24
24
 
25
25
  This example schema is the recommended starting point for users.
@@ -51,7 +51,7 @@
51
51
  version="1.4" is Solr's version number for the schema syntax and semantics. It should
52
52
  not normally be changed by applications.
53
53
  1.0: multiValued attribute did not exist, all fields are multiValued by nature
54
- 1.1: multiValued attribute introduced, false by default
54
+ 1.1: multiValued attribute introduced, false by default
55
55
  1.2: omitTermFreqAndPositions attribute introduced, true by default except for text fields.
56
56
  1.3: removed optional field compress feature
57
57
  1.4: default auto-phrase (QueryParser feature) to off
@@ -88,7 +88,7 @@
88
88
  - If sortMissingLast="false" and sortMissingFirst="false" (the default),
89
89
  then default lucene sorting will be used which places docs without the
90
90
  field first in an ascending sort and last in a descending sort.
91
- -->
91
+ -->
92
92
 
93
93
  <!--
94
94
  Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
@@ -115,7 +115,7 @@
115
115
 
116
116
  <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
117
117
  is a more restricted form of the canonical representation of dateTime
118
- http://www.w3.org/TR/xmlschema-2/#dateTime
118
+ http://www.w3.org/TR/xmlschema-2/#dateTime
119
119
  The trailing "Z" designates UTC time and is mandatory.
120
120
  Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
121
121
  All other components are mandatory.
@@ -130,7 +130,7 @@
130
130
  NOW/DAY+6MONTHS+3DAYS
131
131
  ... 6 months and 3 days in the future from the start of
132
132
  the current day
133
-
133
+
134
134
  Consult the DateField javadocs for more information.
135
135
 
136
136
  Note: For faster range queries, consider the tdate type
@@ -142,11 +142,11 @@
142
142
 
143
143
  <!-- The "RandomSortField" is not used to store or search any
144
144
  data. You can declare fields of this type it in your schema
145
- to generate pseudo-random orderings of your docs for sorting
146
- purposes. The ordering is generated based on the field name
145
+ to generate pseudo-random orderings of your docs for sorting
146
+ purposes. The ordering is generated based on the field name
147
147
  and the version of the index, As long as the index version
148
148
  remains unchanged, and the same field name is reused,
149
- the ordering of the docs will be consistent.
149
+ the ordering of the docs will be consistent.
150
150
  If you want different psuedo-random orderings of documents,
151
151
  for the same version of the index, use a dynamicField and
152
152
  change the name
@@ -351,13 +351,13 @@
351
351
  <filter class="solr.TrimFilterFactory" />
352
352
  <!-- The PatternReplaceFilter gives you the flexibility to use
353
353
  Java Regular expression to replace any sequence of characters
354
- matching a pattern with an arbitrary replacement string,
354
+ matching a pattern with an arbitrary replacement string,
355
355
  which may include back references to portions of the original
356
356
  string matched by the pattern.
357
-
357
+
358
358
  See the Java Regular Expression documentation for more
359
359
  information on pattern and replacement string syntax.
360
-
360
+
361
361
  http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
362
362
  -->
363
363
  <filter class="solr.PatternReplaceFilterFactory"
@@ -365,7 +365,7 @@
365
365
  />
366
366
  </analyzer>
367
367
  </fieldType>
368
-
368
+
369
369
  <fieldtype name="phonetic" stored="false" indexed="true" class="solr.TextField" >
370
370
  <analyzer>
371
371
  <tokenizer class="solr.StandardTokenizerFactory"/>
@@ -379,7 +379,7 @@
379
379
  <!--
380
380
  The DelimitedPayloadTokenFilter can put payloads on tokens... for example,
381
381
  a token of "foo|1.4" would be indexed as "foo" with a payload of 1.4f
382
- Attributes of the DelimitedPayloadTokenFilterFactory :
382
+ Attributes of the DelimitedPayloadTokenFilterFactory :
383
383
  "delimiter" - a one character delimiter. Default is | (pipe)
384
384
  "encoder" - how to encode the following value into a playload
385
385
  float -> org.apache.lucene.analysis.payloads.FloatEncoder,
@@ -406,12 +406,12 @@
406
406
  </fieldType>
407
407
 
408
408
  <!-- since fields of this type are by default not stored or indexed,
409
- any data added to them will be ignored outright. -->
409
+ any data added to them will be ignored outright. -->
410
410
  <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
411
411
 
412
412
  <!-- This point type indexes the coordinates as separate fields (subFields)
413
413
  If subFieldType is defined, it references a type, and a dynamic field
414
- definition is created matching *___<typename>. Alternately, if
414
+ definition is created matching *___<typename>. Alternately, if
415
415
  subFieldSuffix is defined, that is used to create the subFields.
416
416
  Example: if subFieldType="double", then the coordinates would be
417
417
  indexed in fields myloc_0___double,myloc_1___double.
@@ -436,7 +436,7 @@
436
436
  <fields>
437
437
  <!-- Valid attributes for fields:
438
438
  name: mandatory - the name for the field
439
- type: mandatory - the name of a previously defined type from the
439
+ type: mandatory - the name of a previously defined type from the
440
440
  <types> section
441
441
  indexed: true if this field should be indexed (searchable or sortable)
442
442
  stored: true if this field should be retrievable
@@ -449,9 +449,9 @@
449
449
  given field.
450
450
  When using MoreLikeThis, fields used for similarity should be
451
451
  stored for best performance.
452
- termPositions: Store position information with the term vector.
452
+ termPositions: Store position information with the term vector.
453
453
  This will increase storage costs.
454
- termOffsets: Store offset information with the term vector. This
454
+ termOffsets: Store offset information with the term vector. This
455
455
  will increase storage costs.
456
456
  default: a value that should be used if no value is specified
457
457
  when adding a document.
@@ -463,7 +463,7 @@
463
463
  <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
464
464
  <!-- default, catch all search field -->
465
465
  <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>
466
-
466
+
467
467
  <!-- these display fields are NOT multi-valued -->
468
468
  <field name="marc_display" type="string" indexed="false" stored="true" multiValued="false"/>
469
469
  <field name="title_display" type="string" indexed="false" stored="true" multiValued="false"/>
@@ -472,7 +472,7 @@
472
472
  <field name="subtitle_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
473
473
  <field name="author_display" type="string" indexed="false" stored="true" multiValued="false"/>
474
474
  <field name="author_vern_display" type="string" indexed="false" stored="true" multiValued="false"/>
475
-
475
+
476
476
  <!-- these fields are also used for display, so they must be stored -->
477
477
  <field name="isbn_t" type="text" indexed="true" stored="true" multiValued="true"/>
478
478
  <field name="language_facet" type="string" indexed="true" stored="true" multiValued="true" />
@@ -484,11 +484,11 @@
484
484
  <!-- pub_date sort uses new trie-based int fields, which are recommended for any int and are displayable, sortable, and range-quer
485
485
  we use 'tint' for faster range-queries. -->
486
486
  <field name="pub_date_sort" type="tint" indexed="true" stored="true" multiValued="false"/>
487
-
487
+
488
488
  <!-- format is used for facet, display, and choosing which partial to use for the show view, so it must be stored and indexed -->
489
489
  <field name="format" type="string" indexed="true" stored="true"/>
490
490
 
491
-
491
+
492
492
 
493
493
  <!-- Dynamic field definitions. If a field name is not found, dynamicFields
494
494
  will be used if the name matches any of the patterns.
@@ -531,30 +531,24 @@
531
531
  <dynamicField name="*spell" type="textSpell" indexed="true" stored="false" multiValued="true" />
532
532
  <dynamicField name="*suggest" type="textSuggest" indexed="true" stored="false" multiValued="true" />
533
533
 
534
- <!-- uncomment the following to ignore any fields that don't already match an existing
535
- field name or dynamic field, rather than reporting them as an error.
536
- alternately, change the type="ignored" to some other type e.g. "text" if you want
537
- unknown fields indexed and/or stored by default -->
534
+ <!-- uncomment the following to ignore any fields that don't already match an existing
535
+ field name or dynamic field, rather than reporting them as an error.
536
+ alternately, change the type="ignored" to some other type e.g. "text" if you want
537
+ unknown fields indexed and/or stored by default -->
538
538
  <!--dynamicField name="*" type="ignored" multiValued="true" /-->
539
-
539
+
540
540
  </fields>
541
541
 
542
- <!-- Field to use to determine and enforce document uniqueness.
542
+ <!-- Field to use to determine and enforce document uniqueness.
543
543
  Unless this field is marked with required="false", it will be a required field
544
544
  -->
545
545
  <uniqueKey>id</uniqueKey>
546
546
 
547
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
548
- <defaultSearchField>text</defaultSearchField>
549
-
550
- <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
551
- <solrQueryParser defaultOperator="OR"/>
552
-
553
547
  <!-- copyField commands copy one field to another at the time a document
554
548
  is added to the index. It's used either to index the same field differently,
555
549
  or to add multiple fields to the same field for easier/faster searching. -->
556
550
  <!-- Copy Fields -->
557
-
551
+
558
552
  <!-- unstemmed fields -->
559
553
  <copyField source="title_t" dest="title_unstem_search"/>
560
554
  <copyField source="subtitle_t" dest="subtitle_unstem_search"/>
@@ -566,11 +560,11 @@
566
560
  <copyField source="subject_t" dest="subject_unstem_search"/>
567
561
  <copyField source="subject_addl_t" dest="subject_addl_unstem_search"/>
568
562
  <copyField source="subject_topic_facet" dest="subject_topic_unstem_search"/>
569
-
563
+
570
564
  <!-- sort fields -->
571
565
  <copyField source="pub_date" dest="pub_date_sort"/>
572
-
573
-
566
+
567
+
574
568
  <!-- spellcheck fields -->
575
569
  <!-- default spell check; should match fields for default request handler -->
576
570
  <!-- it won't work with a copy of a copy field -->
@@ -588,8 +582,8 @@
588
582
  <!-- subject spell check; should match fields for subject request handler -->
589
583
  <copyField source="subject_topic_facet" dest="subject_spell"/>
590
584
  <copyField source="subject_t" dest="subject_spell"/>
591
- <copyField source="subject_addl_t" dest="subject_spell"/>
592
-
585
+ <copyField source="subject_addl_t" dest="subject_spell"/>
586
+
593
587
  <!-- OpenSearch query field should match request handler search fields -->
594
588
  <copyField source="title_t" dest="opensearch_display"/>
595
589
  <copyField source="subtitle_t" dest="opensearch_display"/>
@@ -600,22 +594,22 @@
600
594
  <copyField source="author_addl_t" dest="opensearch_display"/>
601
595
  <copyField source="subject_topic_facet" dest="opensearch_display"/>
602
596
  <copyField source="subject_t" dest="opensearch_display"/>
603
- <copyField source="subject_addl_t" dest="opensearch_display"/>
597
+ <copyField source="subject_addl_t" dest="opensearch_display"/>
604
598
 
605
599
  <!-- for suggestions -->
606
600
  <copyField source="*_t" dest="suggest"/>
607
601
  <copyField source="*_facet" dest="suggest"/>
608
-
609
- <!-- Above, multiple source fields are copied to the [text] field.
610
- Another way to map multiple source fields to the same
611
- destination field is to use the dynamic field syntax.
602
+
603
+ <!-- Above, multiple source fields are copied to the [text] field.
604
+ Another way to map multiple source fields to the same
605
+ destination field is to use the dynamic field syntax.
612
606
  copyField also supports a maxChars to copy setting. -->
613
-
607
+
614
608
  <!-- <copyField source="*_t" dest="text" maxChars="3000"/> -->
615
609
 
616
610
  <!-- copy name to alphaNameSort, a field designed for sorting by name -->
617
611
  <!-- <copyField source="name" dest="alphaNameSort"/> -->
618
-
612
+
619
613
 
620
614
  <!-- Similarity is the scoring routine for each document vs. a query.
621
615
  A custom similarity may be specified here, but the default is fine
@@ -266,6 +266,17 @@ describe Blacklight::SearchState do
266
266
  end
267
267
  end
268
268
 
269
+ context "when the facet_params is a HWIA" do
270
+ let(:facet_values) { { '0' => 'some_value', '1' => 'another_value' }.with_indifferent_access }
271
+ let(:facet_params) { { 'some_field' => facet_values } }
272
+
273
+ it "removes the facet / value tuple from the query parameters" do
274
+ params = search_state.remove_facet_params('some_field', 'some_value')
275
+ expect(params[:f]['some_field']).not_to include 'some_value'
276
+ expect(params[:f]['some_field']).to include 'another_value'
277
+ end
278
+ end
279
+
269
280
  context "when the facet has configuration" do
270
281
  before do
271
282
  allow(search_state).to receive(:facet_configuration_for_field).with('some_field').and_return(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.11.2
4
+ version: 6.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: exe
19
19
  cert_chain: []
20
- date: 2017-09-12 00:00:00.000000000 Z
20
+ date: 2017-11-14 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -764,7 +764,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
764
764
  version: '0'
765
765
  requirements: []
766
766
  rubyforge_project:
767
- rubygems_version: 2.6.13
767
+ rubygems_version: 2.6.11
768
768
  signing_key:
769
769
  specification_version: 4
770
770
  summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)