blacklight 6.0.0.pre1 → 6.0.0.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/autocomplete.js +32 -0
- data/app/assets/javascripts/blacklight/blacklight.js +4 -0
- data/app/assets/stylesheets/blacklight/_blacklight_base.scss +1 -0
- data/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +30 -0
- data/app/controllers/concerns/blacklight/catalog.rb +1 -1
- data/app/controllers/concerns/blacklight/controller.rb +4 -4
- data/app/controllers/concerns/blacklight/suggest.rb +24 -0
- data/app/controllers/concerns/blacklight/suggest_search.rb +33 -0
- data/app/controllers/suggest_controller.rb +3 -0
- data/app/helpers/blacklight/facets_helper_behavior.rb +2 -2
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +2 -2
- data/app/helpers/blacklight/suggest_helper_behavior.rb +10 -0
- data/app/helpers/blacklight/url_helper_behavior.rb +2 -2
- data/app/helpers/suggest_helper.rb +3 -0
- data/app/models/concerns/blacklight/suggest/response.rb +26 -0
- data/app/views/catalog/_per_page_widget.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +2 -2
- data/app/views/catalog/_sort_widget.html.erb +1 -1
- data/app/views/catalog/_zero_results.html.erb +1 -1
- data/blacklight.gemspec +1 -0
- data/config/routes.rb +1 -0
- data/lib/blacklight.rb +8 -4
- data/{app/models → lib}/blacklight/abstract_repository.rb +0 -0
- data/{app/models → lib}/blacklight/configuration.rb +16 -20
- data/{app/models → lib}/blacklight/configuration/context.rb +0 -0
- data/{app/models → lib}/blacklight/configuration/facet_field.rb +0 -0
- data/{app/models → lib}/blacklight/configuration/field.rb +0 -0
- data/{app/models → lib}/blacklight/configuration/fields.rb +0 -0
- data/{app/models → lib}/blacklight/configuration/search_field.rb +0 -0
- data/{app/models → lib}/blacklight/configuration/solr_field.rb +0 -0
- data/{app/models → lib}/blacklight/configuration/sort_field.rb +0 -0
- data/{app/models → lib}/blacklight/configuration/tool_config.rb +0 -0
- data/{app/models → lib}/blacklight/configuration/view_config.rb +0 -0
- data/lib/blacklight/engine.rb +1 -0
- data/{app/models → lib}/blacklight/search_builder.rb +0 -0
- data/lib/blacklight/{path.rb → search_state.rb} +1 -1
- data/lib/blacklight/solr.rb +5 -1
- data/{app/models → lib}/blacklight/solr/repository.rb +0 -0
- data/{app/models → lib}/blacklight/solr/request.rb +0 -0
- data/{app/models → lib}/blacklight/solr/response.rb +10 -9
- data/{app/models → lib}/blacklight/solr/response/facets.rb +0 -0
- data/{app/models → lib}/blacklight/solr/response/group.rb +0 -0
- data/{app/models → lib}/blacklight/solr/response/group_response.rb +0 -0
- data/{app/models → lib}/blacklight/solr/response/more_like_this.rb +0 -0
- data/{app/models → lib}/blacklight/solr/response/pagination_methods.rb +0 -0
- data/{app/models → lib}/blacklight/solr/response/response.rb +0 -0
- data/{app/models → lib}/blacklight/solr/response/spelling.rb +0 -0
- data/{app/models/concerns → lib}/blacklight/solr/search_builder_behavior.rb +0 -0
- data/lib/generators/blacklight/controller_generator.rb +1 -1
- data/lib/generators/blacklight/models_generator.rb +1 -1
- data/lib/generators/blacklight/templates/catalog_controller.rb +4 -0
- data/lib/generators/blacklight/test_support_generator.rb +1 -1
- data/solr/conf/schema.xml +14 -1
- data/solr/conf/solrconfig.xml +21 -0
- data/spec/controllers/blacklight/base_spec.rb +3 -3
- data/spec/controllers/blacklight/suggest_search_spec.rb +22 -0
- data/spec/controllers/suggest_controller_spec.rb +17 -0
- data/spec/helpers/facets_helper_spec.rb +2 -2
- data/spec/helpers/render_constraints_helper_spec.rb +1 -1
- data/spec/helpers/suggest_helper_spec.rb +41 -0
- data/spec/lib/blacklight/{path_spec.rb → search_state_spec.rb} +1 -1
- data/spec/models/blacklight/solr/search_builder_spec.rb +12 -7
- data/spec/models/blacklight/suggest/response_spec.rb +55 -0
- data/spec/support/controller_level_helpers.rb +2 -2
- data/tasks/blacklight.rake +2 -2
- metadata +58 -29
- data/app/models/blacklight/solr/search_builder.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d61d1d33a708476cbac51eba384b3ec074e06e0
|
4
|
+
data.tar.gz: 9d359464738928145735fb316c3a1dbb8b37fe19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4409c43abb35028561d936081809525f8038f34ac8706a8838281e12396df98e4508a141224ea5db103b2a7b6f3f6206c9a5370c89ff987473426ae3ffda90d1
|
7
|
+
data.tar.gz: 6598923fcb1214614d65716faceb7b9da4fb2a540ab2ae91e22389df0fab211978b8e2e6cd11ffd9786afae93f0b3c6a68ae195640388ef00daf8ca80fbebeea
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.0.0.
|
1
|
+
6.0.0.pre2
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/*global Bloodhound */
|
2
|
+
|
3
|
+
Blacklight.onLoad(function() {
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
$('[data-autocomplete-enabled="true"]').each(function() {
|
7
|
+
var $el = $(this);
|
8
|
+
var suggestUrl = $el.data().autocompletePath;
|
9
|
+
|
10
|
+
var terms = new Bloodhound({
|
11
|
+
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
|
12
|
+
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
13
|
+
remote: {
|
14
|
+
url: suggestUrl + '?q=%QUERY',
|
15
|
+
wildcard: '%QUERY'
|
16
|
+
}
|
17
|
+
});
|
18
|
+
|
19
|
+
terms.initialize();
|
20
|
+
|
21
|
+
$el.typeahead({
|
22
|
+
hint: true,
|
23
|
+
highlight: true,
|
24
|
+
minLength: 2
|
25
|
+
},
|
26
|
+
{
|
27
|
+
name: 'terms',
|
28
|
+
displayKey: 'term',
|
29
|
+
source: terms.ttAdapter()
|
30
|
+
});
|
31
|
+
});
|
32
|
+
});
|
@@ -11,6 +11,7 @@
|
|
11
11
|
//= require blacklight/search_context
|
12
12
|
//= require blacklight/collapsable
|
13
13
|
//= require blacklight/facet_load
|
14
|
+
//= require blacklight/autocomplete
|
14
15
|
//
|
15
16
|
//Bootstrap JS for providing collapsable tablet/mobile menu/alert boxes
|
16
17
|
//= require bootstrap/transition
|
@@ -19,6 +20,9 @@
|
|
19
20
|
//= require bootstrap/alert
|
20
21
|
//= require bootstrap/modal
|
21
22
|
|
23
|
+
// Twitter Typeahead for autocomplete
|
24
|
+
//= require twitter/typeahead
|
25
|
+
|
22
26
|
/* Blacklight has a Javascript setup meant to support local disabling,
|
23
27
|
modification, and use of Blacklight behaviors.
|
24
28
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
.twitter-typeahead {
|
2
|
+
float: left;
|
3
|
+
width: 100%;
|
4
|
+
z-index: 10000;
|
5
|
+
|
6
|
+
.tt-input.form-control {
|
7
|
+
width: 100%;
|
8
|
+
}
|
9
|
+
|
10
|
+
.tt-hint.form-control {
|
11
|
+
width: 100%;
|
12
|
+
}
|
13
|
+
|
14
|
+
.tt-menu {
|
15
|
+
@extend .dropdown-menu;
|
16
|
+
font-family: $font-family-base;
|
17
|
+
width: 100%;
|
18
|
+
}
|
19
|
+
|
20
|
+
.tt-cursor {
|
21
|
+
background-color: $dropdown-link-hover-bg;
|
22
|
+
color: $dropdown-link-hover-color;
|
23
|
+
text-decoration: none;
|
24
|
+
}
|
25
|
+
|
26
|
+
.tt-suggestion {
|
27
|
+
font-size: 14px;
|
28
|
+
padding: 5px 5px 5px 10px;
|
29
|
+
}
|
30
|
+
}
|
@@ -100,7 +100,7 @@ module Blacklight::Catalog
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def action_success_redirect_path
|
103
|
-
|
103
|
+
search_state.url_for_document(blacklight_config.document_model.new(id: params[:id]))
|
104
104
|
end
|
105
105
|
|
106
106
|
##
|
@@ -24,7 +24,7 @@ module Blacklight::Controller
|
|
24
24
|
helper_method :has_user_authentication_provider?
|
25
25
|
helper_method :blacklight_config, :blacklight_configuration_context
|
26
26
|
helper_method :search_action_url, :search_action_path, :search_facet_url
|
27
|
-
helper_method :
|
27
|
+
helper_method :search_state
|
28
28
|
|
29
29
|
|
30
30
|
# This callback runs when a user first logs in
|
@@ -64,9 +64,9 @@ module Blacklight::Controller
|
|
64
64
|
has_user_authentication_provider? and current_user
|
65
65
|
end
|
66
66
|
|
67
|
-
# @return [Blacklight::
|
68
|
-
def
|
69
|
-
@
|
67
|
+
# @return [Blacklight::SearchState] a memoized instance of the parameter state.
|
68
|
+
def search_state
|
69
|
+
@search_state ||= Blacklight::SearchState.new(params, blacklight_config)
|
70
70
|
end
|
71
71
|
|
72
72
|
# Default route to the search action (used e.g. in global partials). Override this method
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Blacklight
|
2
|
+
module Suggest
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
include Blacklight::Configurable
|
7
|
+
include Blacklight::SearchHelper
|
8
|
+
|
9
|
+
copy_blacklight_config_from(CatalogController)
|
10
|
+
end
|
11
|
+
|
12
|
+
def index
|
13
|
+
respond_to do |format|
|
14
|
+
format.json do
|
15
|
+
render json: suggestions_service.suggestions
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def suggestions_service
|
21
|
+
Blacklight::SuggestSearch.new(params, repository).suggestions
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Blacklight
|
2
|
+
class SuggestSearch
|
3
|
+
attr_reader :request_params, :repository
|
4
|
+
|
5
|
+
##
|
6
|
+
# @param [Hash] params
|
7
|
+
def initialize(params, repository)
|
8
|
+
@request_params = { q: params[:q] }
|
9
|
+
@repository = repository
|
10
|
+
end
|
11
|
+
|
12
|
+
##
|
13
|
+
# For now, only use the q parameter to create a
|
14
|
+
# Blacklight::Suggest::Response
|
15
|
+
# @return [Blacklight::Suggest::Response]
|
16
|
+
def suggestions
|
17
|
+
Blacklight::Suggest::Response.new suggest_results, request_params, suggest_handler_path
|
18
|
+
end
|
19
|
+
|
20
|
+
##
|
21
|
+
# Query the suggest handler using RSolr::Client::send_and_receive
|
22
|
+
# @return [RSolr::HashWithResponse]
|
23
|
+
def suggest_results
|
24
|
+
repository.connection.send_and_receive(suggest_handler_path, params: request_params)
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# @return [String]
|
29
|
+
def suggest_handler_path
|
30
|
+
repository.blacklight_config.autocomplete_path
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -138,7 +138,7 @@ module Blacklight::FacetsHelperBehavior
|
|
138
138
|
if facet_config.url_method
|
139
139
|
send(facet_config.url_method, facet_field, item)
|
140
140
|
else
|
141
|
-
search_action_path(
|
141
|
+
search_action_path(search_state.add_facet_params_and_redirect(facet_field, item))
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
@@ -146,7 +146,7 @@ module Blacklight::FacetsHelperBehavior
|
|
146
146
|
# Standard display of a SELECTED facet value (e.g. without a link and with a remove button)
|
147
147
|
# @params (see #render_facet_value)
|
148
148
|
def render_selected_facet_value(facet_field, item)
|
149
|
-
remove_href = search_action_path(
|
149
|
+
remove_href = search_action_path(search_state.remove_facet_params(facet_field, item))
|
150
150
|
content_tag(:span, class: "facet-label") do
|
151
151
|
content_tag(:span, facet_display_value(facet_field, item), class: "selected") +
|
152
152
|
# remove link
|
@@ -48,7 +48,7 @@ module Blacklight::RenderConstraintsHelperBehavior
|
|
48
48
|
# @return [String]
|
49
49
|
def render_constraints_filters(localized_params = params)
|
50
50
|
return "".html_safe unless localized_params[:f]
|
51
|
-
path = Blacklight::
|
51
|
+
path = Blacklight::SearchState.new(localized_params, blacklight_config)
|
52
52
|
content = []
|
53
53
|
localized_params[:f].each_pair do |facet,values|
|
54
54
|
content << render_filter_element(facet, values, path)
|
@@ -61,7 +61,7 @@ module Blacklight::RenderConstraintsHelperBehavior
|
|
61
61
|
# Render a single facet's constraint
|
62
62
|
# @param [String] facet field
|
63
63
|
# @param [Array<String>] values selected facet values
|
64
|
-
# @param [Blacklight::
|
64
|
+
# @param [Blacklight::SearchState] path query parameters
|
65
65
|
# @return [String]
|
66
66
|
def render_filter_element(facet, values, path)
|
67
67
|
facet_config = facet_configuration_for_field(facet)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Blacklight
|
2
|
+
module SuggestHelperBehavior
|
3
|
+
##
|
4
|
+
# @return [Boolean] should autocomplete be enabled in the UI
|
5
|
+
def autocomplete_enabled?
|
6
|
+
blacklight_config.autocomplete_enabled.present? &&
|
7
|
+
blacklight_config.autocomplete_path.present?
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -6,7 +6,7 @@ module Blacklight::UrlHelperBehavior
|
|
6
6
|
# to provide more interesting routing to
|
7
7
|
# documents
|
8
8
|
def url_for_document(doc, options = {})
|
9
|
-
|
9
|
+
search_state.url_for_document(doc, options)
|
10
10
|
end
|
11
11
|
|
12
12
|
# link_to_document(doc, 'VIEW', :counter => 3)
|
@@ -146,7 +146,7 @@ module Blacklight::UrlHelperBehavior
|
|
146
146
|
# @param [Blacklight::SolrResponse::Group]
|
147
147
|
# @return [Hash]
|
148
148
|
def add_group_facet_params_and_redirect group
|
149
|
-
|
149
|
+
search_state.add_facet_params_and_redirect(group.field, group.key, params)
|
150
150
|
end
|
151
151
|
|
152
152
|
# A URL to refworks export, with an embedded callback URL to this app.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Blacklight
|
2
|
+
module Suggest
|
3
|
+
class Response
|
4
|
+
attr_reader :response, :request_params, :suggest_path
|
5
|
+
|
6
|
+
##
|
7
|
+
# Creates a suggest response
|
8
|
+
# @param [RSolr::HashWithResponse] response
|
9
|
+
# @param [Hash] request_params
|
10
|
+
# @param [String] suggest_path
|
11
|
+
def initialize(response, request_params, suggest_path)
|
12
|
+
@response = response
|
13
|
+
@request_params = request_params
|
14
|
+
@suggest_path = suggest_path
|
15
|
+
end
|
16
|
+
|
17
|
+
##
|
18
|
+
# Trys the suggestor response to return suggestions if they are
|
19
|
+
# present
|
20
|
+
# @return [Array]
|
21
|
+
def suggestions
|
22
|
+
response.try(:[], suggest_path).try(:[], 'mySuggester').try(:[], request_params[:q]).try(:[], 'suggestions') || []
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -7,7 +7,7 @@
|
|
7
7
|
</button>
|
8
8
|
<ul class="dropdown-menu" role="menu">
|
9
9
|
<%- per_page_options_for_select.each do |(label, count)| %>
|
10
|
-
<li><%= link_to(label, url_for(
|
10
|
+
<li><%= link_to(label, url_for(search_state.params_for_search(per_page: count))) %></li>
|
11
11
|
<%- end -%>
|
12
12
|
</ul>
|
13
13
|
</div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= form_tag search_action_url, method: :get, class: 'search-query-form clearfix navbar-form', role: 'search' do %>
|
2
|
-
<%= render_hash_as_hidden_fields(
|
2
|
+
<%= render_hash_as_hidden_fields(search_state.params_for_search.except(:q, :search_field, :qt, :page, :utf8)) %>
|
3
3
|
<div class="input-group">
|
4
4
|
<% if search_fields.length > 1 %>
|
5
5
|
<span class="input-group-addon for-search-field">
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<label for="q" class="sr-only"><%= t('blacklight.search.form.search.label') %></label>
|
14
|
-
<%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search_q q form-control", id: "q", autofocus: should_autofocus_on_search_box
|
14
|
+
<%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search_q q form-control", id: "q", autofocus: should_autofocus_on_search_box?, data: { autocomplete_enabled: autocomplete_enabled?, autocomplete_path: blacklight.suggest_index_path } %>
|
15
15
|
|
16
16
|
<span class="input-group-btn">
|
17
17
|
<button type="submit" class="btn btn-primary search-btn" id="search">
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<ul class="dropdown-menu" role="menu">
|
8
8
|
<%- active_sort_fields.each do |sort_key, field_config| %>
|
9
|
-
<li><%= link_to(field_config.label, url_for(
|
9
|
+
<li><%= link_to(field_config.label, url_for(search_state.params_for_search(sort: sort_key))) %></li>
|
10
10
|
<%- end -%>
|
11
11
|
</ul>
|
12
12
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<%- if params[:q] and params[:search_field] and params[:search_field] != blacklight_config.default_search_field.try(:key) -%>
|
8
8
|
<li><%= t 'blacklight.search.zero_results.search_fields', :search_fields => search_field_label(params) %> -
|
9
|
-
<%= link_to t('blacklight.search.zero_results.search_everything', field: blacklight_config.default_search_field.label), url_for(
|
9
|
+
<%= link_to t('blacklight.search.zero_results.search_everything', field: blacklight_config.default_search_field.label), url_for(search_state.params_for_search(search_field: blacklight_config.default_search_field.key)) %>
|
10
10
|
</li>
|
11
11
|
<%- end %>
|
12
12
|
|
data/blacklight.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_dependency "rsolr", "~> 1.0.11" # Library for interacting with rSolr.
|
25
25
|
s.add_dependency "bootstrap-sass", "~> 3.2"
|
26
26
|
s.add_dependency "deprecation"
|
27
|
+
s.add_dependency "twitter-typeahead-rails", '~> 0.11'
|
27
28
|
|
28
29
|
s.add_development_dependency "solr_wrapper"
|
29
30
|
s.add_development_dependency "rspec-rails", "~> 3.0"
|
data/config/routes.rb
CHANGED
@@ -6,4 +6,5 @@ Blacklight::Engine.routes.draw do
|
|
6
6
|
put "saved_searches/save/:id", :to => "saved_searches#save", :as => "save_search"
|
7
7
|
delete "saved_searches/forget/:id", :to => "saved_searches#forget", :as => "forget_search"
|
8
8
|
post "saved_searches/forget/:id", :to => "saved_searches#forget"
|
9
|
+
resources :suggest, only: :index, defaults: { format: 'json' }
|
9
10
|
end
|
data/lib/blacklight.rb
CHANGED
@@ -4,10 +4,14 @@ require 'deprecation'
|
|
4
4
|
require 'blacklight/utils'
|
5
5
|
|
6
6
|
module Blacklight
|
7
|
-
autoload :
|
8
|
-
autoload :
|
9
|
-
autoload :
|
10
|
-
autoload :
|
7
|
+
autoload :AbstractRepository, 'blacklight/abstract_repository'
|
8
|
+
autoload :Configuration, 'blacklight/configuration'
|
9
|
+
autoload :Exceptions, 'blacklight/exceptions'
|
10
|
+
autoload :Parameters, 'blacklight/parameters'
|
11
|
+
autoload :Routes, 'blacklight/routes'
|
12
|
+
autoload :SearchBuilder, 'blacklight/search_builder'
|
13
|
+
autoload :SearchState, 'blacklight/search_state'
|
14
|
+
autoload :Solr, 'blacklight/solr'
|
11
15
|
|
12
16
|
extend Deprecation
|
13
17
|
|
File without changes
|
@@ -3,18 +3,22 @@ module Blacklight
|
|
3
3
|
# Blacklight::Configuration holds the configuration for a Blacklight::Controller, including
|
4
4
|
# fields to display, facets to show, sort options, and search fields.
|
5
5
|
class Configuration < OpenStructWithHashAccess
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
6
|
+
|
7
|
+
|
8
|
+
# Using required_dependency to work around Rails autoloading
|
9
|
+
# problems when developing blacklight. Without this, any change
|
10
|
+
# to this class breaks other classes in this namespace
|
11
|
+
|
12
|
+
require_dependency 'blacklight/configuration/context'
|
13
|
+
require_dependency 'blacklight/configuration/view_config'
|
14
|
+
require_dependency 'blacklight/configuration/tool_config'
|
15
|
+
# XXX this isn't very pretty, but it works.
|
16
|
+
require_dependency 'blacklight/configuration/fields'
|
17
|
+
require_dependency 'blacklight/configuration/field'
|
18
|
+
require_dependency 'blacklight/configuration/solr_field'
|
19
|
+
require_dependency 'blacklight/configuration/search_field'
|
20
|
+
require_dependency 'blacklight/configuration/facet_field'
|
21
|
+
require_dependency 'blacklight/configuration/sort_field'
|
18
22
|
include Fields
|
19
23
|
|
20
24
|
# Set up Blacklight::Configuration.default_values to contain
|
@@ -208,14 +212,6 @@ module Blacklight
|
|
208
212
|
|
209
213
|
def locate_search_builder_class
|
210
214
|
::SearchBuilder
|
211
|
-
rescue NameError => e
|
212
|
-
# If the NameError is a result of the SearchBuilder having a
|
213
|
-
# NameError (e.g. NoMethodError) within it then raise the error.
|
214
|
-
raise e if Object.const_defined? "::SearchBuilder"
|
215
|
-
|
216
|
-
# Otherwise the NameError was a result of not being able to find SearchBuilder
|
217
|
-
Deprecation.warn(Configuration, "Your application is missing the SearchBuilder. Have you run `rails generate blacklight:search_builder`? Falling back to Blacklight::Solr::SearchBuilder")
|
218
|
-
Blacklight::Solr::SearchBuilder
|
219
215
|
end
|
220
216
|
|
221
217
|
def facet_paginator_class
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/blacklight/engine.rb
CHANGED
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Blacklight
|
2
2
|
# This class encapsulates the search state as represented by the query
|
3
3
|
# parameters namely: :f, :q, :page, :per_page and, :sort
|
4
|
-
class
|
4
|
+
class SearchState
|
5
5
|
include Blacklight::Facet
|
6
6
|
attr_reader :blacklight_config # Must be called blacklight_config, because Blacklight::Facet calls blacklight_config.
|
7
7
|
attr_reader :params
|
data/lib/blacklight/solr.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
module Blacklight
|
2
2
|
module Solr
|
3
|
+
autoload :Repository, 'blacklight/solr/repository'
|
4
|
+
autoload :Request, 'blacklight/solr/request'
|
5
|
+
autoload :Response, 'blacklight/solr/response'
|
6
|
+
autoload :SearchBuilderBehavior, 'blacklight/solr/search_builder_behavior'
|
3
7
|
end
|
4
|
-
end
|
8
|
+
end
|
File without changes
|
File without changes
|
@@ -1,15 +1,16 @@
|
|
1
1
|
class Blacklight::Solr::Response < HashWithIndifferentAccess
|
2
2
|
extend Deprecation
|
3
|
-
extend ActiveSupport::Autoload
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
# Using required_dependency to work around Rails autoloading
|
5
|
+
# problems when developing blacklight. Without this, any change
|
6
|
+
# to this class breaks other classes in this namespace
|
7
|
+
require_dependency 'blacklight/solr/response/pagination_methods'
|
8
|
+
require_dependency 'blacklight/solr/response/response'
|
9
|
+
require_dependency 'blacklight/solr/response/spelling'
|
10
|
+
require_dependency 'blacklight/solr/response/facets'
|
11
|
+
require_dependency 'blacklight/solr/response/more_like_this'
|
12
|
+
require_dependency 'blacklight/solr/response/group_response'
|
13
|
+
require_dependency 'blacklight/solr/response/group'
|
13
14
|
|
14
15
|
include PaginationMethods
|
15
16
|
include Spelling
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -29,7 +29,7 @@ module Blacklight
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def inject_blacklight_routes
|
32
|
-
route <<-EOF
|
32
|
+
route <<-EOF.strip_heredoc
|
33
33
|
concern :searchable, Blacklight::Routes::Searchable.new
|
34
34
|
|
35
35
|
resource :catalog, only: [:index], as: 'catalog', path: '/catalog', controller: 'catalog' do
|
@@ -24,7 +24,7 @@ This generator makes the following changes to your application:
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def add_routes
|
27
|
-
route <<-EOF
|
27
|
+
route <<-EOF.strip_heredoc
|
28
28
|
concern :exportable, Blacklight::Routes::Exportable.new
|
29
29
|
|
30
30
|
resources :solr_documents, only: [:show], path: '/catalog', controller: 'catalog' do
|
@@ -180,5 +180,9 @@ class <%= controller_name.classify %>Controller < ApplicationController
|
|
180
180
|
# If there are more than this many search results, no spelling ("did you
|
181
181
|
# mean") suggestion is offered.
|
182
182
|
config.spell_max = 5
|
183
|
+
|
184
|
+
# Configuration for autocomplete suggestor
|
185
|
+
config.autocomplete_enabled = true
|
186
|
+
config.autocomplete_path = 'suggest'
|
183
187
|
end
|
184
188
|
end
|
@@ -15,7 +15,7 @@ Generate blacklight testing configurations for blacklight's own tests, or for bl
|
|
15
15
|
def alternate_controller
|
16
16
|
copy_file "alternate_controller.rb", "app/controllers/alternate_controller.rb"
|
17
17
|
|
18
|
-
routing_code = <<-EOF
|
18
|
+
routing_code = <<-EOF.strip_heredoc
|
19
19
|
resource :alternate, controller: 'alternate', only: [:index] do
|
20
20
|
concerns :searchable
|
21
21
|
end
|
data/solr/conf/schema.xml
CHANGED
@@ -314,6 +314,15 @@
|
|
314
314
|
</analyzer>
|
315
315
|
</fieldType>
|
316
316
|
|
317
|
+
<fieldType class="solr.TextField" name="textSuggest" positionIncrementGap="100">
|
318
|
+
<analyzer>
|
319
|
+
<tokenizer class="solr.KeywordTokenizerFactory"/>
|
320
|
+
<filter class="solr.StandardFilterFactory"/>
|
321
|
+
<filter class="solr.LowerCaseFilterFactory"/>
|
322
|
+
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
|
323
|
+
</analyzer>
|
324
|
+
</fieldType>
|
325
|
+
|
317
326
|
<!-- charFilter + WhitespaceTokenizer -->
|
318
327
|
<!--
|
319
328
|
<fieldType name="text_char_norm" class="solr.TextField" positionIncrementGap="100" >
|
@@ -519,6 +528,7 @@
|
|
519
528
|
<dynamicField name="*_sort" type="alphaOnlySort" indexed="true" stored="false" multiValued="false" />
|
520
529
|
<dynamicField name="*_unstem_search" type="text_general" indexed="true" stored="false" multiValued="true" />
|
521
530
|
<dynamicField name="*spell" type="textSpell" indexed="true" stored="false" multiValued="true" />
|
531
|
+
<dynamicField name="*suggest" type="textSuggest" indexed="true" stored="false" multiValued="true" />
|
522
532
|
|
523
533
|
<!-- uncomment the following to ignore any fields that don't already match an existing
|
524
534
|
field name or dynamic field, rather than reporting them as an error.
|
@@ -591,7 +601,10 @@
|
|
591
601
|
<copyField source="subject_t" dest="opensearch_display"/>
|
592
602
|
<copyField source="subject_addl_t" dest="opensearch_display"/>
|
593
603
|
|
594
|
-
|
604
|
+
<!-- for suggestions -->
|
605
|
+
<copyField source="*_t" dest="suggest"/>
|
606
|
+
<copyField source="*_facet" dest="suggest"/>
|
607
|
+
|
595
608
|
<!-- Above, multiple source fields are copied to the [text] field.
|
596
609
|
Another way to map multiple source fields to the same
|
597
610
|
destination field is to use the dynamic field syntax.
|
data/solr/conf/solrconfig.xml
CHANGED
@@ -387,5 +387,26 @@
|
|
387
387
|
-->
|
388
388
|
</searchComponent>
|
389
389
|
|
390
|
+
<searchComponent name="suggest" class="solr.SuggestComponent">
|
391
|
+
<lst name="suggester">
|
392
|
+
<str name="name">mySuggester</str>
|
393
|
+
<str name="lookupImpl">FuzzyLookupFactory</str>
|
394
|
+
<str name="suggestAnalyzerFieldType">textSuggest</str>
|
395
|
+
<str name="buildOnCommit">true</str>
|
396
|
+
<str name="field">suggest</str>
|
397
|
+
</lst>
|
398
|
+
</searchComponent>
|
399
|
+
|
400
|
+
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
|
401
|
+
<lst name="defaults">
|
402
|
+
<str name="suggest">true</str>
|
403
|
+
<str name="suggest.count">5</str>
|
404
|
+
<str name="suggest.dictionary">mySuggester</str>
|
405
|
+
</lst>
|
406
|
+
<arr name="components">
|
407
|
+
<str>suggest</str>
|
408
|
+
</arr>
|
409
|
+
</requestHandler>
|
410
|
+
|
390
411
|
</config>
|
391
412
|
|
@@ -4,13 +4,13 @@ describe Blacklight::Base do
|
|
4
4
|
let(:controller) { (Class.new(ApplicationController) { include Blacklight::Base }).new }
|
5
5
|
subject { controller}
|
6
6
|
|
7
|
-
describe "#
|
7
|
+
describe "#search_state" do
|
8
8
|
let(:params) { double }
|
9
9
|
before { allow(controller).to receive_messages(params: params) }
|
10
|
-
subject { controller.send(:
|
10
|
+
subject { controller.send(:search_state) }
|
11
11
|
|
12
12
|
it "creates a path object" do
|
13
|
-
expect(subject).to be_kind_of Blacklight::
|
13
|
+
expect(subject).to be_kind_of Blacklight::SearchState
|
14
14
|
expect(subject.params).to be params
|
15
15
|
end
|
16
16
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Blacklight::SuggestSearch do
|
4
|
+
let(:params) { {q: 'test'} }
|
5
|
+
let(:suggest_path) { 'suggest' }
|
6
|
+
let(:connection) { double('connection', send_and_receive: 'sent')}
|
7
|
+
let(:repository) { double('repository', connection: connection) }
|
8
|
+
let(:suggest_search) { described_class.new(params, repository)}
|
9
|
+
describe '#suggestions' do
|
10
|
+
it 'returns a Blacklight::Suggest::Response' do
|
11
|
+
expect(suggest_search).to receive(:suggest_results).and_return([])
|
12
|
+
expect(suggest_search).to receive(:suggest_handler_path).and_return(suggest_path)
|
13
|
+
expect(suggest_search.suggestions).to be_an Blacklight::Suggest::Response
|
14
|
+
end
|
15
|
+
end
|
16
|
+
describe '#suggest_results' do
|
17
|
+
it 'should call send_and_recieve from a repository connection' do
|
18
|
+
expect(suggest_search).to receive(:suggest_handler_path).and_return(suggest_path)
|
19
|
+
expect(suggest_search.suggest_results).to eq 'sent'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SuggestController do
|
4
|
+
routes { Blacklight::Engine.routes }
|
5
|
+
describe 'GET index' do
|
6
|
+
it 'returns JSON' do
|
7
|
+
get :index, format: 'json'
|
8
|
+
expect(response.body).to eq [].to_json
|
9
|
+
end
|
10
|
+
it 'returns suggestions' do
|
11
|
+
get :index, format: 'json', q: 'new'
|
12
|
+
json = JSON.parse(response.body)
|
13
|
+
expect(json.count).to eq 3
|
14
|
+
expect(json.first['term']).to eq 'new jersey'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -301,11 +301,11 @@ describe FacetsHelper do
|
|
301
301
|
|
302
302
|
describe "render_facet_value" do
|
303
303
|
let(:item) { double(:value => 'A', :hits => 10) }
|
304
|
-
let(:
|
304
|
+
let(:search_state) { double(add_facet_params_and_redirect: { controller: 'catalog' }) }
|
305
305
|
before do
|
306
306
|
allow(helper).to receive(:facet_configuration_for_field).with('simple_field').and_return(double(:query => nil, :date => nil, :helper_method => nil, :single => false, :url_method => nil))
|
307
307
|
allow(helper).to receive(:facet_display_value).and_return('Z')
|
308
|
-
allow(helper).to receive(:
|
308
|
+
allow(helper).to receive(:search_state).and_return(search_state)
|
309
309
|
allow(helper).to receive(:search_action_path) do |*args|
|
310
310
|
search_catalog_path *args
|
311
311
|
end
|
@@ -34,7 +34,7 @@ describe RenderConstraintsHelper do
|
|
34
34
|
end
|
35
35
|
subject { helper.render_filter_element('type', ['journal'], path) }
|
36
36
|
|
37
|
-
let(:path) { Blacklight::
|
37
|
+
let(:path) { Blacklight::SearchState.new({:q=>'biz'}, config) }
|
38
38
|
|
39
39
|
it "should have a link relative to the current url" do
|
40
40
|
expect(subject).to have_link "Remove constraint Item Type: journal", href: "/catalog?q=biz"
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SuggestHelper do
|
4
|
+
before do
|
5
|
+
allow(helper).to receive(:blacklight_config).and_return(blacklight_config)
|
6
|
+
end
|
7
|
+
describe '#autocomplete_enabled?' do
|
8
|
+
describe 'with autocomplete config' do
|
9
|
+
let(:blacklight_config) do
|
10
|
+
Blacklight::Configuration.new.configure do |config|
|
11
|
+
config.autocomplete_enabled = true
|
12
|
+
config.autocomplete_path = 'suggest'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
it 'is enabled' do
|
16
|
+
expect(helper.autocomplete_enabled?).to be true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
describe 'without disabled config' do
|
20
|
+
let(:blacklight_config) do
|
21
|
+
Blacklight::Configuration.new.configure do |config|
|
22
|
+
config.autocomplete_enabled = false
|
23
|
+
config.autocomplete_path = 'suggest'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
it 'is disabled' do
|
27
|
+
expect(helper.autocomplete_enabled?).to be false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
describe 'without path config' do
|
31
|
+
let(:blacklight_config) do
|
32
|
+
Blacklight::Configuration.new.configure do |config|
|
33
|
+
config.autocomplete_enabled = true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
it 'is disabled' do
|
37
|
+
expect(helper.autocomplete_enabled?).to be false
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Blacklight::Solr::
|
3
|
+
describe Blacklight::Solr::SearchBuilderBehavior do
|
4
4
|
let(:single_facet) { { format: 'Book' } }
|
5
5
|
let(:multi_facets) { { format: 'Book', language_facet: 'Tibetan' } }
|
6
6
|
let(:mult_word_query) { 'tibetan history' }
|
@@ -12,7 +12,12 @@ describe Blacklight::Solr::SearchBuilder do
|
|
12
12
|
|
13
13
|
before { allow(context).to receive(:blacklight_config).and_return(blacklight_config) }
|
14
14
|
|
15
|
-
let(:
|
15
|
+
let(:search_builder_class) do
|
16
|
+
Class.new(Blacklight::SearchBuilder) do
|
17
|
+
include Blacklight::Solr::SearchBuilderBehavior
|
18
|
+
end
|
19
|
+
end
|
20
|
+
let(:search_builder) { search_builder_class.new(context) }
|
16
21
|
|
17
22
|
subject { search_builder.with(user_params) }
|
18
23
|
|
@@ -20,18 +25,18 @@ describe Blacklight::Solr::SearchBuilder do
|
|
20
25
|
context "with two arguments" do
|
21
26
|
subject do
|
22
27
|
Deprecation.silence Blacklight::SearchBuilder do
|
23
|
-
|
28
|
+
search_builder_class.new true, context
|
24
29
|
end
|
25
30
|
end
|
26
31
|
it "uses the class-level default_processor_chain" do
|
27
|
-
expect(subject.processor_chain).to eq
|
32
|
+
expect(subject.processor_chain).to eq search_builder_class.default_processor_chain
|
28
33
|
end
|
29
34
|
end
|
30
35
|
|
31
36
|
context "with one arguments" do
|
32
|
-
subject {
|
37
|
+
subject { search_builder }
|
33
38
|
it "uses the class-level default_processor_chain" do
|
34
|
-
expect(subject.processor_chain).to eq
|
39
|
+
expect(subject.processor_chain).to eq search_builder_class.default_processor_chain
|
35
40
|
end
|
36
41
|
end
|
37
42
|
end
|
@@ -90,7 +95,7 @@ describe Blacklight::Solr::SearchBuilder do
|
|
90
95
|
end
|
91
96
|
|
92
97
|
context "when search_params_logic is customized" do
|
93
|
-
let(:search_builder) {
|
98
|
+
let(:search_builder) { search_builder_class.new(method_chain, context) }
|
94
99
|
let(:method_chain) { [:add_foo_to_solr_params] }
|
95
100
|
|
96
101
|
it "allows customization of search_params_logic" do
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Blacklight::Suggest::Response do
|
4
|
+
let(:empty_response) { described_class.new({}, { q: 'hello' }, 'suggest') }
|
5
|
+
let(:full_response) do
|
6
|
+
described_class.new(
|
7
|
+
{
|
8
|
+
'responseHeader' => {
|
9
|
+
'status' => 200
|
10
|
+
},
|
11
|
+
'suggest' => {
|
12
|
+
'mySuggester' => {
|
13
|
+
'new' => {
|
14
|
+
'numFound' => 3,
|
15
|
+
'suggestions' => [
|
16
|
+
{
|
17
|
+
'term' => 'new jersey',
|
18
|
+
'weight' => 3,
|
19
|
+
'payload' => ''
|
20
|
+
},
|
21
|
+
{
|
22
|
+
'term' => 'new jersey bridgeton biography',
|
23
|
+
'weight' => 3,
|
24
|
+
'payload' => ''
|
25
|
+
},
|
26
|
+
{
|
27
|
+
'term' => 'new jersey bridgeton history',
|
28
|
+
'weight' => 3,
|
29
|
+
'payload' => ''
|
30
|
+
}
|
31
|
+
]
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
},
|
36
|
+
{
|
37
|
+
q: 'new'
|
38
|
+
},
|
39
|
+
'suggest'
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
describe '#initialize' do
|
44
|
+
it 'creates a Blacklight::Suggest::Response' do
|
45
|
+
expect(empty_response).to be_an Blacklight::Suggest::Response
|
46
|
+
end
|
47
|
+
end
|
48
|
+
describe '#suggestions' do
|
49
|
+
it 'returns an array of suggestions' do
|
50
|
+
expect(full_response.suggestions).to be_an Array
|
51
|
+
expect(full_response.suggestions.count).to eq 3
|
52
|
+
expect(full_response.suggestions.first['term']).to eq 'new jersey'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -2,8 +2,8 @@ module ControllerLevelHelpers
|
|
2
2
|
module ControllerViewHelpers
|
3
3
|
include Blacklight::Facet
|
4
4
|
|
5
|
-
def
|
6
|
-
@
|
5
|
+
def search_state
|
6
|
+
@search_state ||= Blacklight::SearchState.new(params, blacklight_config)
|
7
7
|
end
|
8
8
|
|
9
9
|
def blacklight_configuration_context
|
data/tasks/blacklight.rake
CHANGED
@@ -42,7 +42,7 @@ namespace :blacklight do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
desc 'Run Solr and Blacklight for interactive development'
|
45
|
-
task :server do
|
45
|
+
task :server, [:rails_server_args] do |t, args|
|
46
46
|
if File.exists? EngineCart.destination
|
47
47
|
within_test_app do
|
48
48
|
system "bundle update"
|
@@ -56,7 +56,7 @@ namespace :blacklight do
|
|
56
56
|
Rake::Task['blacklight:internal:seed'].invoke
|
57
57
|
|
58
58
|
within_test_app do
|
59
|
-
system "bundle exec rails s"
|
59
|
+
system "bundle exec rails s #{args[:rails_server_args]}"
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
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.0.0.
|
4
|
+
version: 6.0.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
|
-
date: 2015-11-
|
20
|
+
date: 2015-11-06 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -123,6 +123,20 @@ dependencies:
|
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: twitter-typeahead-rails
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0.11'
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0.11'
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: solr_wrapper
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -261,6 +275,7 @@ files:
|
|
261
275
|
- app/assets/images/blacklight/logo.png
|
262
276
|
- app/assets/images/favicon.ico
|
263
277
|
- app/assets/javascripts/blacklight/ajax_modal.js
|
278
|
+
- app/assets/javascripts/blacklight/autocomplete.js
|
264
279
|
- app/assets/javascripts/blacklight/autofocus.js
|
265
280
|
- app/assets/javascripts/blacklight/blacklight.js
|
266
281
|
- app/assets/javascripts/blacklight/bookmark_toggle.js
|
@@ -282,6 +297,7 @@ files:
|
|
282
297
|
- app/assets/stylesheets/blacklight/_pagination.scss
|
283
298
|
- app/assets/stylesheets/blacklight/_search_history.scss
|
284
299
|
- app/assets/stylesheets/blacklight/_search_results.scss
|
300
|
+
- app/assets/stylesheets/blacklight/_twitter_typeahead.scss
|
285
301
|
- app/assets/stylesheets/blacklight/blacklight.scss
|
286
302
|
- app/assets/stylesheets/blacklight/blacklight_defaults.scss
|
287
303
|
- app/controllers/bookmarks_controller.rb
|
@@ -296,8 +312,11 @@ files:
|
|
296
312
|
- app/controllers/concerns/blacklight/search_context.rb
|
297
313
|
- app/controllers/concerns/blacklight/search_fields.rb
|
298
314
|
- app/controllers/concerns/blacklight/search_helper.rb
|
315
|
+
- app/controllers/concerns/blacklight/suggest.rb
|
316
|
+
- app/controllers/concerns/blacklight/suggest_search.rb
|
299
317
|
- app/controllers/saved_searches_controller.rb
|
300
318
|
- app/controllers/search_history_controller.rb
|
319
|
+
- app/controllers/suggest_controller.rb
|
301
320
|
- app/helpers/blacklight/blacklight_helper_behavior.rb
|
302
321
|
- app/helpers/blacklight/catalog_helper_behavior.rb
|
303
322
|
- app/helpers/blacklight/component_helper_behavior.rb
|
@@ -308,6 +327,7 @@ files:
|
|
308
327
|
- app/helpers/blacklight/render_constraints_helper_behavior.rb
|
309
328
|
- app/helpers/blacklight/render_partials_helper.rb
|
310
329
|
- app/helpers/blacklight/search_history_constraints_helper_behavior.rb
|
330
|
+
- app/helpers/blacklight/suggest_helper_behavior.rb
|
311
331
|
- app/helpers/blacklight/url_helper_behavior.rb
|
312
332
|
- app/helpers/blacklight_configuration_helper.rb
|
313
333
|
- app/helpers/blacklight_helper.rb
|
@@ -319,31 +339,9 @@ files:
|
|
319
339
|
- app/helpers/layout_helper.rb
|
320
340
|
- app/helpers/render_constraints_helper.rb
|
321
341
|
- app/helpers/search_history_constraints_helper.rb
|
322
|
-
- app/
|
323
|
-
- app/models/blacklight/configuration.rb
|
324
|
-
- app/models/blacklight/configuration/context.rb
|
325
|
-
- app/models/blacklight/configuration/facet_field.rb
|
326
|
-
- app/models/blacklight/configuration/field.rb
|
327
|
-
- app/models/blacklight/configuration/fields.rb
|
328
|
-
- app/models/blacklight/configuration/search_field.rb
|
329
|
-
- app/models/blacklight/configuration/solr_field.rb
|
330
|
-
- app/models/blacklight/configuration/sort_field.rb
|
331
|
-
- app/models/blacklight/configuration/tool_config.rb
|
332
|
-
- app/models/blacklight/configuration/view_config.rb
|
342
|
+
- app/helpers/suggest_helper.rb
|
333
343
|
- app/models/blacklight/facet_paginator.rb
|
334
|
-
- app/models/blacklight/search_builder.rb
|
335
344
|
- app/models/blacklight/solr/facet_paginator.rb
|
336
|
-
- app/models/blacklight/solr/repository.rb
|
337
|
-
- app/models/blacklight/solr/request.rb
|
338
|
-
- app/models/blacklight/solr/response.rb
|
339
|
-
- app/models/blacklight/solr/response/facets.rb
|
340
|
-
- app/models/blacklight/solr/response/group.rb
|
341
|
-
- app/models/blacklight/solr/response/group_response.rb
|
342
|
-
- app/models/blacklight/solr/response/more_like_this.rb
|
343
|
-
- app/models/blacklight/solr/response/pagination_methods.rb
|
344
|
-
- app/models/blacklight/solr/response/response.rb
|
345
|
-
- app/models/blacklight/solr/response/spelling.rb
|
346
|
-
- app/models/blacklight/solr/search_builder.rb
|
347
345
|
- app/models/bookmark.rb
|
348
346
|
- app/models/concerns/blacklight/configurable.rb
|
349
347
|
- app/models/concerns/blacklight/document.rb
|
@@ -364,7 +362,7 @@ files:
|
|
364
362
|
- app/models/concerns/blacklight/solr/document/more_like_this.rb
|
365
363
|
- app/models/concerns/blacklight/solr/document/schema_org.rb
|
366
364
|
- app/models/concerns/blacklight/solr/document/sms.rb
|
367
|
-
- app/models/concerns/blacklight/
|
365
|
+
- app/models/concerns/blacklight/suggest/response.rb
|
368
366
|
- app/models/concerns/blacklight/token_based_user.rb
|
369
367
|
- app/models/concerns/blacklight/user.rb
|
370
368
|
- app/models/record_mailer.rb
|
@@ -472,14 +470,37 @@ files:
|
|
472
470
|
- db/migrate/20140202020202_create_bookmarks.rb
|
473
471
|
- db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb
|
474
472
|
- lib/blacklight.rb
|
473
|
+
- lib/blacklight/abstract_repository.rb
|
474
|
+
- lib/blacklight/configuration.rb
|
475
|
+
- lib/blacklight/configuration/context.rb
|
476
|
+
- lib/blacklight/configuration/facet_field.rb
|
477
|
+
- lib/blacklight/configuration/field.rb
|
478
|
+
- lib/blacklight/configuration/fields.rb
|
479
|
+
- lib/blacklight/configuration/search_field.rb
|
480
|
+
- lib/blacklight/configuration/solr_field.rb
|
481
|
+
- lib/blacklight/configuration/sort_field.rb
|
482
|
+
- lib/blacklight/configuration/tool_config.rb
|
483
|
+
- lib/blacklight/configuration/view_config.rb
|
475
484
|
- lib/blacklight/engine.rb
|
476
485
|
- lib/blacklight/exceptions.rb
|
477
486
|
- lib/blacklight/parameters.rb
|
478
|
-
- lib/blacklight/path.rb
|
479
487
|
- lib/blacklight/routes.rb
|
480
488
|
- lib/blacklight/routes/exportable.rb
|
481
489
|
- lib/blacklight/routes/searchable.rb
|
490
|
+
- lib/blacklight/search_builder.rb
|
491
|
+
- lib/blacklight/search_state.rb
|
482
492
|
- lib/blacklight/solr.rb
|
493
|
+
- lib/blacklight/solr/repository.rb
|
494
|
+
- lib/blacklight/solr/request.rb
|
495
|
+
- lib/blacklight/solr/response.rb
|
496
|
+
- lib/blacklight/solr/response/facets.rb
|
497
|
+
- lib/blacklight/solr/response/group.rb
|
498
|
+
- lib/blacklight/solr/response/group_response.rb
|
499
|
+
- lib/blacklight/solr/response/more_like_this.rb
|
500
|
+
- lib/blacklight/solr/response/pagination_methods.rb
|
501
|
+
- lib/blacklight/solr/response/response.rb
|
502
|
+
- lib/blacklight/solr/response/spelling.rb
|
503
|
+
- lib/blacklight/solr/search_builder_behavior.rb
|
483
504
|
- lib/blacklight/utils.rb
|
484
505
|
- lib/blacklight/version.rb
|
485
506
|
- lib/generators/blacklight/assets_generator.rb
|
@@ -523,10 +544,12 @@ files:
|
|
523
544
|
- spec/controllers/blacklight/facet_spec.rb
|
524
545
|
- spec/controllers/blacklight/search_fields_spec.rb
|
525
546
|
- spec/controllers/blacklight/search_helper_spec.rb
|
547
|
+
- spec/controllers/blacklight/suggest_search_spec.rb
|
526
548
|
- spec/controllers/bookmarks_controller_spec.rb
|
527
549
|
- spec/controllers/catalog_controller_spec.rb
|
528
550
|
- spec/controllers/saved_searches_controller_spec.rb
|
529
551
|
- spec/controllers/search_history_controller_spec.rb
|
552
|
+
- spec/controllers/suggest_controller_spec.rb
|
530
553
|
- spec/features/alternate_controller_spec.rb
|
531
554
|
- spec/features/bookmarks_spec.rb
|
532
555
|
- spec/features/did_you_mean_spec.rb
|
@@ -550,9 +573,10 @@ files:
|
|
550
573
|
- spec/helpers/layout_helper_spec.rb
|
551
574
|
- spec/helpers/render_constraints_helper_spec.rb
|
552
575
|
- spec/helpers/search_history_constraints_helper_spec.rb
|
576
|
+
- spec/helpers/suggest_helper_spec.rb
|
553
577
|
- spec/helpers/url_helper_spec.rb
|
554
578
|
- spec/lib/blacklight/parameters_spec.rb
|
555
|
-
- spec/lib/blacklight/
|
579
|
+
- spec/lib/blacklight/search_state_spec.rb
|
556
580
|
- spec/lib/blacklight/utils_spec.rb
|
557
581
|
- spec/lib/blacklight_spec.rb
|
558
582
|
- spec/lib/tasks/blacklight_task_spec.rb
|
@@ -577,6 +601,7 @@ files:
|
|
577
601
|
- spec/models/blacklight/solr/response/group_spec.rb
|
578
602
|
- spec/models/blacklight/solr/response_spec.rb
|
579
603
|
- spec/models/blacklight/solr/search_builder_spec.rb
|
604
|
+
- spec/models/blacklight/suggest/response_spec.rb
|
580
605
|
- spec/models/blacklight/user_spec.rb
|
581
606
|
- spec/models/bookmark_spec.rb
|
582
607
|
- spec/models/record_mailer_spec.rb
|
@@ -648,10 +673,12 @@ test_files:
|
|
648
673
|
- spec/controllers/blacklight/facet_spec.rb
|
649
674
|
- spec/controllers/blacklight/search_fields_spec.rb
|
650
675
|
- spec/controllers/blacklight/search_helper_spec.rb
|
676
|
+
- spec/controllers/blacklight/suggest_search_spec.rb
|
651
677
|
- spec/controllers/bookmarks_controller_spec.rb
|
652
678
|
- spec/controllers/catalog_controller_spec.rb
|
653
679
|
- spec/controllers/saved_searches_controller_spec.rb
|
654
680
|
- spec/controllers/search_history_controller_spec.rb
|
681
|
+
- spec/controllers/suggest_controller_spec.rb
|
655
682
|
- spec/features/alternate_controller_spec.rb
|
656
683
|
- spec/features/bookmarks_spec.rb
|
657
684
|
- spec/features/did_you_mean_spec.rb
|
@@ -675,9 +702,10 @@ test_files:
|
|
675
702
|
- spec/helpers/layout_helper_spec.rb
|
676
703
|
- spec/helpers/render_constraints_helper_spec.rb
|
677
704
|
- spec/helpers/search_history_constraints_helper_spec.rb
|
705
|
+
- spec/helpers/suggest_helper_spec.rb
|
678
706
|
- spec/helpers/url_helper_spec.rb
|
679
707
|
- spec/lib/blacklight/parameters_spec.rb
|
680
|
-
- spec/lib/blacklight/
|
708
|
+
- spec/lib/blacklight/search_state_spec.rb
|
681
709
|
- spec/lib/blacklight/utils_spec.rb
|
682
710
|
- spec/lib/blacklight_spec.rb
|
683
711
|
- spec/lib/tasks/blacklight_task_spec.rb
|
@@ -702,6 +730,7 @@ test_files:
|
|
702
730
|
- spec/models/blacklight/solr/response/group_spec.rb
|
703
731
|
- spec/models/blacklight/solr/response_spec.rb
|
704
732
|
- spec/models/blacklight/solr/search_builder_spec.rb
|
733
|
+
- spec/models/blacklight/suggest/response_spec.rb
|
705
734
|
- spec/models/blacklight/user_spec.rb
|
706
735
|
- spec/models/bookmark_spec.rb
|
707
736
|
- spec/models/record_mailer_spec.rb
|
@@ -1,7 +0,0 @@
|
|
1
|
-
module Blacklight::Solr
|
2
|
-
# @deprecated In 6.0 you should have this class generated into your application and Blacklight will
|
3
|
-
# no longer need to provide it.
|
4
|
-
class SearchBuilder < Blacklight::SearchBuilder
|
5
|
-
include Blacklight::Solr::SearchBuilderBehavior
|
6
|
-
end
|
7
|
-
end
|