Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Align with webarchive-discovery Solr 7.
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ruebot committed Oct 12, 2018
1 parent ef0c872 commit 3e034d2
Show file tree
Hide file tree
Showing 31 changed files with 2,531 additions and 521 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require: rubocop-rspec
AllCops:
Exclude:
- '.internal_test_app/**/*'
- '.internal_test_gem/**/*'
- 'bin/**/*'
- 'db/**/*'
- 'lib/generators/warclight/templates/**/*'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified app/assets/images/blacklight/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/javascripts/warclight/warclight.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Vendor Scripts
3 changes: 2 additions & 1 deletion app/assets/stylesheets/warclight/application.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/* Warclight application scss */
@import 'bootstrap/functions';
@import 'bootstrap/variables';
1 change: 0 additions & 1 deletion app/assets/stylesheets/warclight/warclight.scss

This file was deleted.

5 changes: 5 additions & 0 deletions lib/generators/warclight/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def include_warclight_solrdocument
end
end

def install_blacklight_range_limit
generate 'blacklight_range_limit:install'
end

def add_custom_routes
inject_into_file 'config/routes.rb', after: "mount Blacklight::Engine => '/'" do
"\n mount Warclight::Engine => '/'\n"
Expand All @@ -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"
Expand Down
17 changes: 8 additions & 9 deletions lib/generators/warclight/templates/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 10 additions & 14 deletions solr/conf/elevate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,15 @@
-->
<elevate>
<!-- Query elevation examples
<query text="foo bar">
<doc id="1" />
<doc id="2" />
<doc id="3" />
</query>
for use with techproducts example
<query text="foo bar">
<doc id="1" />
<doc id="2" />
<doc id="3" />
</query>

<query text="ipod">
<doc id="MA147LL/A" /> <!-- put the actual ipod at the top -->
<doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
</query>

<query text="ipod">
<doc id="MA147LL/A" /> put the actual ipod at the top
<doc id="IW-02" exclude="true" /> exclude this cable
</query>
-->

</elevate>
6 changes: 0 additions & 6 deletions solr/conf/lang/contractions_fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,3 @@ qu
n
s
j
d
c
jusqu
quoiqu
lorsqu
puisqu
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_da.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_fi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions solr/conf/lang/stopwords_fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_hu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_it.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_nl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_no.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_pt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_ru.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions solr/conf/lang/stopwords_sv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 3e034d2

Please sign in to comment.