Skip to content

Commit

Permalink
Merge 8c477a3 into 796c2f0
Browse files Browse the repository at this point in the history
  • Loading branch information
jrochkind committed Jan 24, 2018
2 parents 796c2f0 + 8c477a3 commit f49a5d3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 39 deletions.
2 changes: 2 additions & 0 deletions lib/sufia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
require 'sufia/inflections'
require 'kaminari_route_prefix'

require 'sufia/hydra_derivatives_compat'

module Sufia
extend ActiveSupport::Autoload

Expand Down
17 changes: 17 additions & 0 deletions lib/sufia/hydra_derivatives_compat.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Workaround to accidental backwards breaking change in hydra-derivatives 7.4,
# removing a method that should have only been deprecated.
# https://github.com/samvera/hydra-derivatives/issues/181

hydra_derivatives_gem = Gem.loaded_specs["hydra-derivatives"]
if hydra_derivatives_gem &&
(hydra_derivatives_gem.version.release >= Gem::Version.new('3.4.0')) &&
(hydra_derivatives_gem.version.release < Gem::Version.new('3.5')) &&
!Hydra::Derivatives::IoDecorator.instance_methods.include?(:original_name=)

# rubocop:disable Alias
Hydra::Derivatives::IoDecorator.class_eval do
alias original_name= original_filename=
deprecation_deprecate :"original_name=" => 'original_name= has been deprecated. Use original_filename= instead. This will be removed in hydra-derivatives 4.0'
end
# rubocop:enable Alias
end
72 changes: 33 additions & 39 deletions solr/config/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,32 +59,32 @@

<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" />
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
<fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>

<!-- Default numeric field types. -->
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>

<!-- trie numeric field types for faster range queries -->
<fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>

<!-- The format for this date field is of the form 1995-12-31T23:59:59Z
Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
-->
<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
<!-- A Trie based date field for faster date range queries and date faceting. -->
<fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>


<!-- This point type indexes the coordinates as separate fields (subFields)
If subFieldType is defined, it references a type, and a dynamic field
definition is created matching *___<typename>. Alternately, if
definition is created matching *___<typename>. Alternately, if
subFieldSuffix is defined, that is used to create the subFields.
Example: if subFieldType="double", then the coordinates would be
indexed in fields myloc_0___double,myloc_1___double.
Expand All @@ -94,33 +94,33 @@
users normally should not need to know about them.
-->
<fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>

<!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>

<!-- An alternative geospatial field type new to Solr 4. It supports multiValued and polygon shapes.
For more information about this and other Spatial fields new to Solr 4, see:
http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
-->
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
geo="true" distErrPct="0.025" maxDistErr="0.000009" distanceUnits="degrees" />

<fieldType name="text" class="solr.TextField" omitNorms="false">
<analyzer>
<tokenizer class="solr.ICUTokenizerFactory"/>
<filter class="solr.ICUFoldingFilterFactory"/> <!-- NFKC, case folding, diacritics removed -->
<filter class="solr.TrimFilterFactory"/>
</analyzer>
</fieldType>

<!-- A text field that only splits on whitespace for exact matching of words -->
<fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.TrimFilterFactory"/>
</analyzer>
</fieldType>

<!-- single token analyzed text, for sorting. Punctuation is significant. -->
<fieldtype name="alphaSort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
<analyzer>
Expand All @@ -129,7 +129,7 @@
<filter class="solr.TrimFilterFactory" />
</analyzer>
</fieldtype>

<!-- A text field with defaults appropriate for English -->
<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
<analyzer>
Expand All @@ -144,7 +144,7 @@
<filter class="solr.TrimFilterFactory"/>
</analyzer>
</fieldType>

<!-- queries for paths match documents at that path, or in descendent paths -->
<fieldType name="descendent_path" class="solr.TextField">
<analyzer type="index">
Expand All @@ -154,7 +154,7 @@
<tokenizer class="solr.KeywordTokenizerFactory" />
</analyzer>
</fieldType>

<!-- queries for paths match documents at that path, or in ancestor paths -->
<fieldType name="ancestor_path" class="solr.TextField">
<analyzer type="index">
Expand All @@ -179,12 +179,12 @@
<fields>
<!-- If you remove this field, you must _also_ disable the update log in solrconfig.xml
or Solr won't start. _version_ and update log are required for SolrCloud
-->
-->
<field name="_version_" type="long" indexed="true" stored="true"/>

<field name="id" type="string" stored="true" indexed="true" multiValued="false" required="true"/>
<field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>

<field name="lat" type="tdouble" stored="true" indexed="true" multiValued="false"/>
<field name="lng" type="tdouble" stored="true" indexed="true" multiValued="false"/>

Expand All @@ -201,7 +201,7 @@
<dynamicField name="*_timv" type="text" stored="false" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
<dynamicField name="*_tsiv" type="text" stored="true" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
<dynamicField name="*_tsimv" type="text" stored="true" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>

<!-- English text (_te...) -->
<dynamicField name="*_tei" type="text_en" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_teim" type="text_en" stored="false" indexed="true" multiValued="true"/>
Expand All @@ -213,7 +213,7 @@
<dynamicField name="*_teimv" type="text_en" stored="false" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
<dynamicField name="*_tesiv" type="text_en" stored="true" indexed="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/>
<dynamicField name="*_tesimv" type="text_en" stored="true" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>

<!-- string (_s...) -->
<dynamicField name="*_si" type="string" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_sim" type="string" stored="false" indexed="true" multiValued="true"/>
Expand All @@ -222,23 +222,23 @@
<dynamicField name="*_ssi" type="string" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_ssim" type="string" stored="true" indexed="true" multiValued="true"/>
<dynamicField name="*_ssort" type="alphaSort" stored="false" indexed="true" multiValued="false"/>

<!-- integer (_i...) -->
<dynamicField name="*_ii" type="int" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_iim" type="int" stored="false" indexed="true" multiValued="true"/>
<dynamicField name="*_is" type="int" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_ism" type="int" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_isi" type="int" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_isim" type="int" stored="true" indexed="true" multiValued="true"/>

<!-- trie integer (_it...) (for faster range queries) -->
<dynamicField name="*_iti" type="tint" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_itim" type="tint" stored="false" indexed="true" multiValued="true"/>
<dynamicField name="*_its" type="tint" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_itsm" type="tint" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_itsi" type="tint" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_itsim" type="tint" stored="true" indexed="true" multiValued="true"/>

<!-- date (_dt...) -->
<!-- The format for this date field is of the form 1995-12-31T23:59:59Z
Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z -->
Expand All @@ -248,68 +248,68 @@
<dynamicField name="*_dtsm" type="date" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_dtsi" type="date" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_dtsim" type="date" stored="true" indexed="true" multiValued="true"/>

<!-- trie date (_dtt...) (for faster range queries) -->
<dynamicField name="*_dtti" type="tdate" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_dttim" type="tdate" stored="false" indexed="true" multiValued="true"/>
<dynamicField name="*_dtts" type="tdate" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_dttsm" type="tdate" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_dttsi" type="tdate" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_dttsim" type="tdate" stored="true" indexed="true" multiValued="true"/>

<!-- long (_l...) -->
<dynamicField name="*_li" type="long" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_lim" type="long" stored="false" indexed="true" multiValued="true"/>
<dynamicField name="*_ls" type="long" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_lsm" type="long" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_lsi" type="long" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_lsim" type="long" stored="true" indexed="true" multiValued="true"/>

<!-- trie long (_lt...) (for faster range queries) -->
<dynamicField name="*_lti" type="tlong" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_ltim" type="tlong" stored="false" indexed="true" multiValued="true"/>
<dynamicField name="*_lts" type="tlong" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_ltsm" type="tlong" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_ltsi" type="tlong" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_ltsim" type="tlong" stored="true" indexed="true" multiValued="true"/>

<!-- double (_db...) -->
<dynamicField name="*_dbi" type="double" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_dbim" type="double" stored="false" indexed="true" multiValued="true"/>
<dynamicField name="*_dbs" type="double" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_dbsm" type="double" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_dbsi" type="double" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_dbsim" type="double" stored="true" indexed="true" multiValued="true"/>

<!-- trie double (_dbt...) (for faster range queries) -->
<dynamicField name="*_dbti" type="tdouble" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_dbtim" type="tdouble" stored="false" indexed="true" multiValued="true"/>
<dynamicField name="*_dbts" type="tdouble" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_dbtsm" type="tdouble" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_dbtsi" type="tdouble" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_dbtsim" type="tdouble" stored="true" indexed="true" multiValued="true"/>

<!-- float (_f...) -->
<dynamicField name="*_fi" type="float" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_fim" type="float" stored="false" indexed="true" multiValued="true"/>
<dynamicField name="*_fs" type="float" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_fsm" type="float" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_fsi" type="float" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_fsim" type="float" stored="true" indexed="true" multiValued="true"/>

<!-- trie float (_ft...) (for faster range queries) -->
<dynamicField name="*_fti" type="tfloat" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_ftim" type="tfloat" stored="false" indexed="true" multiValued="true"/>
<dynamicField name="*_fts" type="tfloat" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_ftsm" type="tfloat" stored="true" indexed="false" multiValued="true"/>
<dynamicField name="*_ftsi" type="tfloat" stored="true" indexed="true" multiValued="false"/>
<dynamicField name="*_ftsim" type="tfloat" stored="true" indexed="true" multiValued="true"/>

<!-- boolean (_b...) -->
<dynamicField name="*_bi" type="boolean" stored="false" indexed="true" multiValued="false"/>
<dynamicField name="*_bs" type="boolean" stored="true" indexed="false" multiValued="false"/>
<dynamicField name="*_bsi" type="boolean" stored="true" indexed="true" multiValued="false"/>

<!-- Type used to index the lat and lon components for the "location" FieldType -->
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" />

Expand All @@ -329,17 +329,11 @@

</fields>

<!-- Field to use to determine and enforce document uniqueness.
<!-- Field to use to determine and enforce document uniqueness.
Unless this field is marked with required="false", it will be a required field
-->
<uniqueKey>id</uniqueKey>

<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<!-- <defaultSearchField>text</defaultSearchField> -->

<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="OR"/>

<!-- copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field differently,
or to add multiple fields to the same field for easier/faster searching. -->
Expand Down

0 comments on commit f49a5d3

Please sign in to comment.