From 3e034d223bcf82c233c0ea06c8e95de05894b6fd Mon Sep 17 00:00:00 2001 From: nruest Date: Fri, 12 Oct 2018 14:10:35 -0400 Subject: [PATCH] Align with webarchive-discovery Solr 7. - Remove content field search - Move field searches from handlers to qf - Use webarchive-discovery Solr 7 setup - Update to use Blacklight 7.0.0rc1 and Blacklight Range Limit 7.0.0rc2 - Resolves #45 - Resolves #46 - Resolves #47 --- .rubocop.yml | 1 + Gemfile | 2 +- app/assets/images/blacklight/logo.png | Bin 5588 -> 4924 bytes app/assets/javascripts/warclight/warclight.js | 1 + .../stylesheets/warclight/application.scss | 3 +- .../stylesheets/warclight/warclight.scss | 1 - lib/generators/warclight/install_generator.rb | 5 + .../warclight/templates/catalog_controller.rb | 17 +- solr/conf/elevate.xml | 24 +- solr/conf/lang/contractions_fr.txt | 6 - solr/conf/lang/stopwords_da.txt | 2 - solr/conf/lang/stopwords_de.txt | 2 - solr/conf/lang/stopwords_es.txt | 2 - solr/conf/lang/stopwords_fi.txt | 2 - solr/conf/lang/stopwords_fr.txt | 5 +- solr/conf/lang/stopwords_hu.txt | 2 - solr/conf/lang/stopwords_it.txt | 2 - solr/conf/lang/stopwords_nl.txt | 2 - solr/conf/lang/stopwords_no.txt | 2 - solr/conf/lang/stopwords_pt.txt | 2 - solr/conf/lang/stopwords_ru.txt | 2 - solr/conf/lang/stopwords_sv.txt | 2 - solr/conf/schema.xml | 847 ++++--- solr/conf/solrconfig.xml | 2073 +++++++++++++++-- solr/conf/solrcore.properties | 1 + solr/conf/stopwords_path.txt | 7 + solr/conf/synonyms.txt | 26 +- .../concerns/warclight/solr_document_spec.rb | 2 +- spec/spec_helper.rb | 2 +- template.rb | 5 +- warclight.gemspec | 2 + 31 files changed, 2531 insertions(+), 521 deletions(-) create mode 100644 app/assets/javascripts/warclight/warclight.js delete mode 100644 app/assets/stylesheets/warclight/warclight.scss create mode 100644 solr/conf/solrcore.properties create mode 100644 solr/conf/stopwords_path.txt diff --git a/.rubocop.yml b/.rubocop.yml index bbd30f8..ebf4975 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,7 @@ require: rubocop-rspec AllCops: Exclude: - '.internal_test_app/**/*' + - '.internal_test_gem/**/*' - 'bin/**/*' - 'db/**/*' - 'lib/generators/warclight/templates/**/*' diff --git a/Gemfile b/Gemfile index 654098b..772cfb5 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gemspec # engine_cart: 1.1.0 # engine_cart stanza: 0.10.0 # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app. -file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__))) +file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_gem', File.dirname(__FILE__))) if File.exist?(file) begin eval_gemfile file diff --git a/app/assets/images/blacklight/logo.png b/app/assets/images/blacklight/logo.png index 0a3e140ac71c72e70fd2503f6886dbfa0c6f1701..5aabadc3766b402a4a68982931bae25dd505cac0 100644 GIT binary patch delta 4888 zcmV+z6X)#IE4(Ih z*@sbE=w+(>}}?}-yb^*YZ@TI@Yx6F_dI!KGUuH4%zvKqoANsN z%+TZpL#Q+poZBl=2h&5t$8cw&z(B5^w&r1OM0C++hVvShm1I6j~xSVcJN;_o? zzzC~Nxa zY&i`VF|k|@dw(^64*=ZZbbIbd*j~nzj6wi400sgWV6{m)t4->r4Y@|F&fqQe_`K8Y z>FaXXqeYW$|DkGU=>SXxU<5GKYLhawVb_S&QS4QZX#f^mZBlp6m7zKPin9R70P_4k zZwmmYN-zx?u>h-0N>`7=tu|?BJ5@qS=d-$H72ICw+kaXx_{twM#sm(a&T5mo1IPf7 ztqr?ItORUUo3u?e&{tb+(j#rk^OMd+y&=WXSaUcf&60xx`{W>iwTQ>HvQoQcPjk9G zGqj=Chy}mTyBokQ09FFv03Ng2q$x>N#w6EoZLTehgq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d&5cv*4LDe*Wd0Y1kFt|J&D%$br;b!Glx3PR$uM8`nm zZa*RtGGcm@=_2A!n}6ut>al?OmDLA<+Y`SbSzQCbZNP2q0d*}pjhJ>;6gh#qhNfMP zk({Ki*JEN|yzmsq2>3h>I?61vBtL^CvrA}hX+B~ZsAn*OBW!bx46)2MW}ix%=w0fu z#;Q0uU!oQHX2<{i%{FgsLt`5-JsD&JdhXoPD?F|N5%RJ*1HiA^G*1pRcZ+oBjyM$qp=lx`w865!#b)LnkMEsyct+%%V++C7|b~ z7CMVPju~1wEiKI83m=*u|HzTXJz5ISg2uhs+Tsj(S&%ZID;kY{F>Rjr0I+J;G}b8k z2jY8wqKXE927jQWzNY%+vTWG{g0=P^6Q1l@MalF!eD?flcoSf99O&p89NIi6BDjv} z`rxd*%M#al75!jC-MnzxJn!-tYb;VpC)wwlJ8X*Rax{dJhBZXi`xiLt8w){)yS2SWs1j*G+!I0{ViH zhnrghWvN@875(E~D`t14O_2uHm?RQo<Uau@im_J-ax>v23^Gw '/'" do "\n mount Warclight::Engine => '/'\n" @@ -27,6 +31,7 @@ def add_custom_routes def assets copy_file 'warclight.scss', 'app/assets/stylesheets/warclight.scss' + copy_file 'warclight.js', 'app/assets/javascripts/warclight.js' inject_into_file 'app/assets/javascripts/application.js', after: '//= require blacklight/blacklight' do "\n//= require bootstrap/scrollspy\n" \ "\n//= require bootstrap/tab\n" diff --git a/lib/generators/warclight/templates/catalog_controller.rb b/lib/generators/warclight/templates/catalog_controller.rb index 7334b10..853ac27 100644 --- a/lib/generators/warclight/templates/catalog_controller.rb +++ b/lib/generators/warclight/templates/catalog_controller.rb @@ -16,7 +16,10 @@ class CatalogController < ApplicationController ## Default parameters to send to solr for all search-like requests. See also SearchBuilder#processed_parameters config.default_solr_params = { - rows: 10 + rows: 10, + 'q.alt': '*:*', + defType: 'edismax', + echoParams: 'explicit' } # solr field configuration for search results/index views @@ -113,24 +116,20 @@ class CatalogController < ApplicationController # This one uses all the defaults set by the solr request handler. Which # solr request handler? The one set in config[:default_solr_parameters][:qt], # since we aren't specifying it otherwise. - config.add_search_field 'text', label: 'Text' do |field| + config.add_search_field 'text', label: 'All Text' do |field| field.include_in_simple_select = true end config.add_search_field 'title', label: 'Title' do |field| - field.qt = 'title_search' - end - - config.add_search_field 'content', label: 'Content' do |field| - field.qt = 'content_search' + field.solr_parameters = { 'qf': 'title' } end config.add_search_field 'url', label: 'URL' do |field| - field.qt = 'url_search' + field.solr_parameters = { 'qf': 'url' } end config.add_search_field 'host', label: 'Host' do |field| - field.qt = 'host_search' + field.solr_parameters = { 'qf': 'host' } end # Field-based searches. We have registered handlers in the Solr configuration diff --git a/solr/conf/elevate.xml b/solr/conf/elevate.xml index 2c09ebe..25d5ceb 100644 --- a/solr/conf/elevate.xml +++ b/solr/conf/elevate.xml @@ -24,19 +24,15 @@ --> - + + - - put the actual ipod at the top - exclude this cable - ---> - diff --git a/solr/conf/lang/contractions_fr.txt b/solr/conf/lang/contractions_fr.txt index f1bba51..722db58 100644 --- a/solr/conf/lang/contractions_fr.txt +++ b/solr/conf/lang/contractions_fr.txt @@ -7,9 +7,3 @@ qu n s j -d -c -jusqu -quoiqu -lorsqu -puisqu diff --git a/solr/conf/lang/stopwords_da.txt b/solr/conf/lang/stopwords_da.txt index 42e6145..a3ff5fe 100644 --- a/solr/conf/lang/stopwords_da.txt +++ b/solr/conf/lang/stopwords_da.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | A Danish stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. diff --git a/solr/conf/lang/stopwords_de.txt b/solr/conf/lang/stopwords_de.txt index 86525e7..f770384 100644 --- a/solr/conf/lang/stopwords_de.txt +++ b/solr/conf/lang/stopwords_de.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | A German stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. diff --git a/solr/conf/lang/stopwords_es.txt b/solr/conf/lang/stopwords_es.txt index 487d78c..2db1476 100644 --- a/solr/conf/lang/stopwords_es.txt +++ b/solr/conf/lang/stopwords_es.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | A Spanish stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. diff --git a/solr/conf/lang/stopwords_fi.txt b/solr/conf/lang/stopwords_fi.txt index 4372c9a..addad79 100644 --- a/solr/conf/lang/stopwords_fi.txt +++ b/solr/conf/lang/stopwords_fi.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | forms of BE diff --git a/solr/conf/lang/stopwords_fr.txt b/solr/conf/lang/stopwords_fr.txt index 749abae..c00837e 100644 --- a/solr/conf/lang/stopwords_fr.txt +++ b/solr/conf/lang/stopwords_fr.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | A French stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. @@ -169,8 +167,7 @@ eussent | Later additions (from Jean-Christophe Deschamps) ceci | this -cela | that -celà | that +celà  | that cet | this cette | this ici | here diff --git a/solr/conf/lang/stopwords_hu.txt b/solr/conf/lang/stopwords_hu.txt index 37526da..1a96f1d 100644 --- a/solr/conf/lang/stopwords_hu.txt +++ b/solr/conf/lang/stopwords_hu.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | Hungarian stop word list | prepared by Anna Tordai diff --git a/solr/conf/lang/stopwords_it.txt b/solr/conf/lang/stopwords_it.txt index 1219cc7..4cb5b08 100644 --- a/solr/conf/lang/stopwords_it.txt +++ b/solr/conf/lang/stopwords_it.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | An Italian stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. diff --git a/solr/conf/lang/stopwords_nl.txt b/solr/conf/lang/stopwords_nl.txt index 47a2aea..f4d61f5 100644 --- a/solr/conf/lang/stopwords_nl.txt +++ b/solr/conf/lang/stopwords_nl.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | A Dutch stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. diff --git a/solr/conf/lang/stopwords_no.txt b/solr/conf/lang/stopwords_no.txt index a7a2c28..e76f36e 100644 --- a/solr/conf/lang/stopwords_no.txt +++ b/solr/conf/lang/stopwords_no.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | A Norwegian stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. diff --git a/solr/conf/lang/stopwords_pt.txt b/solr/conf/lang/stopwords_pt.txt index acfeb01..276c1b4 100644 --- a/solr/conf/lang/stopwords_pt.txt +++ b/solr/conf/lang/stopwords_pt.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | A Portuguese stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. diff --git a/solr/conf/lang/stopwords_ru.txt b/solr/conf/lang/stopwords_ru.txt index 5527140..6430769 100644 --- a/solr/conf/lang/stopwords_ru.txt +++ b/solr/conf/lang/stopwords_ru.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | a russian stop word list. comments begin with vertical bar. each stop | word is at the start of a line. diff --git a/solr/conf/lang/stopwords_sv.txt b/solr/conf/lang/stopwords_sv.txt index 096f87f..22bddfd 100644 --- a/solr/conf/lang/stopwords_sv.txt +++ b/solr/conf/lang/stopwords_sv.txt @@ -4,8 +4,6 @@ | Also see http://www.opensource.org/licenses/bsd-license.html | - Encoding was converted to UTF-8. | - This notice was added. - | - | NOTE: To use this file with StopFilterFactory, you must specify format="snowball" | A Swedish stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. diff --git a/solr/conf/schema.xml b/solr/conf/schema.xml index 13132a9..ce5bb97 100644 --- a/solr/conf/schema.xml +++ b/solr/conf/schema.xml @@ -16,349 +16,588 @@ limitations under the License. --> + + - - - - - + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - id - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - + + - - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - + diff --git a/solr/conf/solrconfig.xml b/solr/conf/solrconfig.xml index 8634754..ad88f5c 100644 --- a/solr/conf/solrconfig.xml +++ b/solr/conf/solrconfig.xml @@ -1,4 +1,4 @@ - + - + - 6.6.0 + + + + 7.0.1 + + + + + - - - - - - - - + + + + ${solr.data.dir:} - + + + + + + + + + ${solr.hdfs.home:} + + ${solr.hdfs.confdir:} + + ${solr.hdfs.blockcache.enabled:true} + + + + + + + + + + + + + + + + + + 500 + 1000 + + + + + + + 10 + 10 + + + + + ${solr.lock.type:native} + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + ${solr.ulog.dir:} - ${solr.ulog.numVersionBuckets:65536} - - ${solr.autoCommit.maxTime:15000} - false - + + + + + ${solr.autoCommit.maxTime:60000} + false + + + + + + ${solr.autoSoftCommit.maxTime:6000000} + + + + + + + + + + + + + + + 1024 - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + true - 20 - 200 + + + + + + 20 + + + 200 + + + + + + + + *:* + + + false + + + 1 + - - - + + + + + + + + + + + + - + - - *:* - + http://wiki.apache.org/solr/SolrRequestHandler - - - edismax - explicit - 10 - *:* - - title^10 - author^10 - keywords^9 - description^8.5 - wct_title_^10 - wct_description^8.5 - url^15 - content^5 - host^5 - - - title^10 - author^10 - keywords^9 - description^8.5 - wct_title^10 - wct_description^8.5 - url^15 - content^5 - host^5 - - 3 - 0.01 - id access_terms author category collection collection_name collection_number collections comments content content_encoding content_ffb content_first_bytes content_language content_length content_metadata content_metadata_ss content_text_length content_type content_type_droid content_type_ext content_type_full content_type_norm content_type_served content_type_tika content_type_version crawl_date crawl_dates crawl_year crawl_year_month crawl_year_month_day crawl_years description domain elements_used generator hash hashes host host_surt id_long image_colours image_dominant_colour image_faces image_faces_count image_height image_size image_width institution keywords last_modified last_modified_year license_url links links_domains links_hosts links_hosts_surts links_norm links_public_suffixes locations parse_error pdf_pdfa_errors pdf_pdfa_is_valid postcode postcode_district public_suffix publication_date publication_year record_type referrer_url resourcename sentiment sentiment_score server source_file source_file_offset status_code subject text title type url url_norm url_path url_type wayback_date wct_agency wct_collections wct_description wct_instance_id wct_subjects wct_target_id wct_titlexml_root_ns - true - 1 - true - default - true - true - false - 5 + Incoming queries will be dispatched to a specific handler by name + based on the path specified in the request. + + Legacy behavior: If the request path uses "/select" but no Request + Handler has that name, and if handleSelect="true" has been specified in + the requestDispatcher, then the Request Handler is dispatched based on + the qt parameter. Handlers without a leading '/' are accessed this way + like so: http://host/app/[core/]select?qt=name If no qt is + given, then the requestHandler that declares default="true" will be + used or the one named "standard". + + If a Request Handler is declared with startup="lazy", then it will + not be initialized until the first request that uses it. + + --> + + + + + json + explicit + 10 + edismax + AND + 0.1 + + + + + + text + author^5.0 + title^2.0 + description^2.0 + url_search^0.5 + + + text + + + + status_code:200^100 + + *,score + false + 1 + 10 + + + domain + crawl_year + public_suffix + content_type_norm + status_code + host + + on + false + html + true + content + + + + highlight + + + + + + + + + true + json + true + + + + + + + + + + + + + + application/json + + + + + application/csv + + + + + + + true + ignored_ + + + true + links + ignored_ - - spellcheck - - - - - edismax - explicit - 10 - *:* - title - AND - title - title - * - true - 1 - - - - - edismax - explicit - 10 - *:* - content - AND - content - content - * - true - 1 - - - - - edismax - explicit - 10 - *:* - url - AND - url - url - * - true - 1 - - - - - edismax - explicit - 10 - *:* - host - AND - host - host - * - true - 1 - - - - - - text_general + + + + + + + + + + + + + + + + solrpingquery + + + all + + + + + + + + + explicit + true + + + + + + + + + + + + + + + + + textSpell + + + default - text + + + spell + + solr.DirectSolrSpellChecker internal @@ -218,8 +1177,842 @@ 0.01 + + + + + wordbreak + solr.WordBreakSolrSpellChecker + name + true + true + 10 + + + + + + + + + + + + + + + + text + + default + wordbreak + on + true + 10 + 5 + 5 + true + true + 10 + 5 + + + spellcheck + + + + + + + + + + text + true + + + tvComponent + + + + + + + lingo + + + org.carrot2.clustering.lingo.LingoClusteringAlgorithm + + + clustering/carrot2 + + + + + stc + org.carrot2.clustering.stc.STCClusteringAlgorithm + + + + + kmeans + org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm + + + + + + + + + + true + false + + + terms + + + + + + + + + + + + + 100 + + + + + + + + 70 + + 0.5 + + [-\w ,/\n\"']{20,200} + + + + + + + ]]> + ]]> + + + + + + + + + + + + + + + + + + + + + + + + ,, + ,, + ,, + ,, + ,]]> + ]]> + + + + + + 10 + .,!? + + + + + + + WORD + + + en + US + + + + + + + + + + + + + + + + + + + + + + text/plain; charset=UTF-8 + + + + + + + + + 5 + + + + + + + + + + + + + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + title + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestTitle + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + url + 0.005 + true + + + + + true + suggest + true + 5 + true + + + suggestUrl + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + content_type_ext + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestFileFormat + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + links_hosts + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestLinksHosts + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + links_domains + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestLinksDomains + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + links_public_suffixes + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestLinksPublicSuffixes + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + host + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestHost + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + domain + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestDomain + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + public_suffix + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestPublicSuffix + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + author + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestAuthor + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + collection + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestCollection + + + + + + suggest + org.apache.solr.spelling.suggest.Suggester + org.apache.solr.spelling.suggest.tst.TSTLookupFactory + + collections + 0.005 + true + + + + + + + true + suggest + true + 5 + true + + + suggestCollections + + + + + + + *:* + + diff --git a/solr/conf/solrcore.properties b/solr/conf/solrcore.properties new file mode 100644 index 0000000..c842441 --- /dev/null +++ b/solr/conf/solrcore.properties @@ -0,0 +1 @@ +#solr.lock.type=hdfs diff --git a/solr/conf/stopwords_path.txt b/solr/conf/stopwords_path.txt new file mode 100644 index 0000000..c5b8bc8 --- /dev/null +++ b/solr/conf/stopwords_path.txt @@ -0,0 +1,7 @@ +# URL & path elements that should not be indexed (to save space) + +# www is removed by the webarchive-discovery normaliser if it is leading. If it is part of the path we want to keep it, so it is not a stopword + +# All URLs starts with http or https, so definitely remove those +http +https diff --git a/solr/conf/synonyms.txt b/solr/conf/synonyms.txt index eab4ee8..5c85cb8 100644 --- a/solr/conf/synonyms.txt +++ b/solr/conf/synonyms.txt @@ -11,19 +11,19 @@ # limitations under the License. #----------------------------------------------------------------------- -#some test synonym mappings unlikely to appear in real input text -aaafoo => aaabar -bbbfoo => bbbfoo bbbbar -cccfoo => cccbar cccbaz -fooaaa,baraaa,bazaaa +##some test synonym mappings unlikely to appear in real input text +#aaafoo => aaabar +#bbbfoo => bbbfoo bbbbar +#cccfoo => cccbar cccbaz +#fooaaa,baraaa,bazaaa -# Some synonym groups specific to this example -GB,gib,gigabyte,gigabytes -MB,mib,megabyte,megabytes -Television, Televisions, TV, TVs -#notice we use "gib" instead of "GiB" so any WordDelimiterGraphFilter coming -#after us won't split it into two words. +## Some synonym groups specific to this example +#GB,gib,gigabyte,gigabytes +#MB,mib,megabyte,megabytes +#Television, Televisions, TV, TVs +##notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +##after us won't split it into two words. -# Synonym mappings can be used for spelling correction too -pixima => pixma +## Synonym mappings can be used for spelling correction too +#pixima => pixma diff --git a/spec/models/concerns/warclight/solr_document_spec.rb b/spec/models/concerns/warclight/solr_document_spec.rb index 369775e..06f65ee 100644 --- a/spec/models/concerns/warclight/solr_document_spec.rb +++ b/spec/models/concerns/warclight/solr_document_spec.rb @@ -11,7 +11,7 @@ end it 'writes a replay url based on memento time travel response' do - expect(document.replay_link).to eq 'https://digital.library.yorku.ca/wayback/20150113163558/http://www.library.yorku.ca/robots.txt 🔗' + expect(document.replay_link).to eq 'https://web.archive.org/web/20150112225831/https://www.library.yorku.ca/robots.txt 🔗' end context 'when time_travel_response.empty?' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d661538..8ce804a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,7 +4,7 @@ require 'simplecov' SimpleCov.start do - add_filter '/.internal_test_app/' + add_filter '/.internal_test_gem/' add_filter '/spec/' end diff --git a/template.rb b/template.rb index 30782a0..b299760 100644 --- a/template.rb +++ b/template.rb @@ -1,10 +1,7 @@ # frozen_string_literal: true -# We can remove `blacklight` and `blacklight_range_limit` once they are released -# since they are already dependents of Warclight (but we need to pin to particular branches) -gem 'blacklight', github: 'projectblacklight/blacklight' - gem 'warclight', github: 'archivesunleashed/warclight' +gem 'blacklight_range_limit', '7.0.0.rc2' run 'bundle install' diff --git a/warclight.gemspec b/warclight.gemspec index aea2c16..6ef2c62 100644 --- a/warclight.gemspec +++ b/warclight.gemspec @@ -22,9 +22,11 @@ Gem::Specification.new do |s| s.require_paths = ['lib'] s.add_dependency 'blacklight', '7.0.0.rc1' + s.add_dependency 'blacklight_range_limit', '7.0.0.rc2' s.add_dependency 'rails', '~> 5.0' s.add_development_dependency 'bundler', '~> 1.14' + s.add_development_dependency 'capybara' s.add_development_dependency 'engine_cart' s.add_development_dependency 'mocha' s.add_development_dependency 'poltergeist'