4 |
5 |
6 |
7 |
8 |
Days in Sample:
9 |
<%= "#{@days_in_sample}" %>
10 | <% if @page_title=='spelling-suggestion'||@page_title=='best-bets-regular'||@page_title=='Top Searches' %>
11 |
12 |
13 | <% end %>
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_graph_best_bets.html.erb:
--------------------------------------------------------------------------------
1 |
<%= @page_title %>
2 |
Most Frequent Best-Bets
3 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_graph_clicks_overview.html.erb:
--------------------------------------------------------------------------------
1 |
<%= @page_title %>
2 |
Frequency of Modules Clicked
3 |
7 |
8 |
Frequency of Result-Type Guides Clicked
9 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_graph_general_statistics.html.erb:
--------------------------------------------------------------------------------
1 |
<%= @page_title %>
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_graph_sessions_details.html.erb:
--------------------------------------------------------------------------------
1 |
<%= @page_title %>
2 |
Sessions by Location
3 |
4 |
5 |
6 |
7 |
8 | <%= render partial: 'sessions_details_location_filters' %>
9 |
10 |
11 |
12 |
Sessions by Access Device
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: 'sessions_details_device_filters' %>
19 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_graph_sessions_overview.html.erb:
--------------------------------------------------------------------------------
1 |
<%= @page_title %>
2 |
Sessions Overview
3 |
4 |
5 |
6 |
7 |
8 | <%= render partial: 'sessions_overview_graph_filters' %>
9 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_graph_spelling_suggestions.html.erb:
--------------------------------------------------------------------------------
1 |
<%= @page_title %>
2 |
Most Frequent Spelling Suggestions
3 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_graph_top_searches.html.erb:
--------------------------------------------------------------------------------
1 |
<%= @page_title %>
2 |
Most Frequent Searches
3 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_menu.html.erb:
--------------------------------------------------------------------------------
1 |
11 |
12 |
30 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_sessions_details_device_filters.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
Device Graph Filters
3 |
8 |
9 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_sessions_details_location_filters.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
Location Graph Filters
3 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/_sessions_overview_graph_filters.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
Graph Filters
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/clicks_overview.html.erb:
--------------------------------------------------------------------------------
1 | <% title("#{@page_title} | ") %>
2 | <%= render partial: 'datatables' %>
3 |
4 | <%= render partial: 'menu' %>
5 |
6 | <%= render partial: 'graph_clicks_overview' %>
7 |
8 | <%= render partial: "date_range" %>
9 |
10 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/index.html.erb:
--------------------------------------------------------------------------------
1 | <% title("#{@page_title} | ") %>
2 | <%= render partial: 'datatables' %>
3 |
4 | <%= render partial: 'menu' %>
5 |
6 |
General Statistics
7 | <%= render partial: 'graph_general_statistics' %>
8 |
9 | <%= render partial: "date_range" %>
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/realtime.html.erb:
--------------------------------------------------------------------------------
1 | <% title %>
2 |
3 |
4 |
Realtime Searches
5 |
What you see below is a stream of searches as they happen in real time.
6 |
11 |
12 |
13 |
14 | <%= javascript_include_tag File.join(QuickSearch::Engine::APP_CONFIG['realtime_url'], '/socket.io/socket.io.js') %>
15 | <%= javascript_include_tag 'realtime' %>
16 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/sessions_details.html.erb:
--------------------------------------------------------------------------------
1 | <% title("#{@page_title} | ") %>
2 | <%= render partial: 'datatables' %>
3 |
4 | <%= render partial: "menu" %>
5 |
6 | <%= render partial: 'graph_sessions_details' %>
7 |
8 | <%= render partial: "date_range" %>
9 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/sessions_overview.html.erb:
--------------------------------------------------------------------------------
1 | <% title("#{@page_title} | ") %>
2 | <%= render partial: 'datatables' %>
3 |
4 | <%= render partial: "menu" %>
5 |
6 | <%= render partial: 'graph_sessions_overview' %>
7 |
8 | <%= render partial: "date_range" %>
9 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/top_searches.html.erb:
--------------------------------------------------------------------------------
1 | <% title("#{@page_title} | ") %>
2 | <%= render partial: 'datatables' %>
3 |
4 | <%= render partial: "menu" %>
5 |
6 | <%= render partial: 'graph_top_searches' %>
7 |
8 | <%= render partial: "date_range" %>
9 |
--------------------------------------------------------------------------------
/app/views/quick_search/appstats/top_spot.html.erb:
--------------------------------------------------------------------------------
1 | <% title("#{@page_title} | ") %>
2 | <%= render partial: 'datatables' %>
3 |
4 | <%= render partial: "menu" %>
5 |
6 | <% if @page_title=='spelling-suggestion' %>
7 | <%= render partial: 'graph_spelling_suggestions' %>
8 | <% end %>
9 | <% if @page_title=='best-bets-regular' %>
10 | <%= render partial: 'graph_best_bets' %>
11 | <% end %>
12 |
13 | <%= render partial: "date_range" %>
14 |
15 |
--------------------------------------------------------------------------------
/app/views/quick_search/kaminari/_first_page.html.erb:
--------------------------------------------------------------------------------
1 | <%# Link to the "First" page
2 | - available local variables
3 | url: url to the first page
4 | current_page: a page object for the currently displayed page
5 | total_pages: total number of pages
6 | per_page: number of items to fetch per page
7 | remote: data-remote
8 | -%>
9 |
10 |
11 | <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
12 |
13 |
--------------------------------------------------------------------------------
/app/views/quick_search/kaminari/_gap.html.erb:
--------------------------------------------------------------------------------
1 | <%# Non-link tag that stands for skipped pages...
2 | - available local variables
3 | current_page: a page object for the currently displayed page
4 | total_pages: total number of pages
5 | per_page: number of items to fetch per page
6 | remote: data-remote
7 | -%>
8 |
9 |
10 | <%= link_to raw(t 'views.pagination.truncate'), '#' %>
11 |
12 |
--------------------------------------------------------------------------------
/app/views/quick_search/kaminari/_last_page.html.erb:
--------------------------------------------------------------------------------
1 | <%# Link to the "Last" page
2 | - available local variables
3 | url: url to the last page
4 | current_page: a page object for the currently displayed page
5 | total_pages: total number of pages
6 | per_page: number of items to fetch per page
7 | remote: data-remote
8 | -%>
9 |
10 |
11 | <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
12 |
--------------------------------------------------------------------------------
/app/views/quick_search/kaminari/_next_page.html.erb:
--------------------------------------------------------------------------------
1 | <%# Link to the "Next" page
2 | - available local variables
3 | url: url to the next page
4 | current_page: a page object for the currently displayed page
5 | total_pages: total number of pages
6 | per_page: number of items to fetch per page
7 | remote: data-remote
8 | -%>
9 |
10 |
11 | <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
12 |
--------------------------------------------------------------------------------
/app/views/quick_search/kaminari/_page.html.erb:
--------------------------------------------------------------------------------
1 | <%# Link showing page number
2 | - available local variables
3 | page: a page object for "this" page
4 | url: url to this page
5 | current_page: a page object for the currently displayed page
6 | total_pages: total number of pages
7 | per_page: number of items to fetch per page
8 | remote: data-remote
9 | -%>
10 |
11 |
12 | <%= link_to page, page.current? ? '#' : url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
13 |
--------------------------------------------------------------------------------
/app/views/quick_search/kaminari/_paginator.html.erb:
--------------------------------------------------------------------------------
1 | <%# The container tag
2 | - available local variables
3 | current_page: a page object for the currently displayed page
4 | total_pages: total number of pages
5 | per_page: number of items to fetch per page
6 | remote: data-remote
7 | paginator: the paginator that renders the pagination tags inside
8 | -%>
9 | <%= paginator.render do -%>
10 |
25 | <% end -%>
--------------------------------------------------------------------------------
/app/views/quick_search/kaminari/_prev_page.html.erb:
--------------------------------------------------------------------------------
1 | <%# Link to the "Previous" page
2 | - available local variables
3 | url: url to the previous page
4 | current_page: a page object for the currently displayed page
5 | total_pages: total number of pages
6 | per_page: number of items to fetch per page
7 | remote: data-remote
8 | -%>
9 |
10 | <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
11 |
12 |
--------------------------------------------------------------------------------
/app/views/quick_search/opensearch/opensearch.xml.builder:
--------------------------------------------------------------------------------
1 | xml.instruct!
2 | xml.OpenSearchDescription(:xmlns => 'http://a9.com/-/spec/opensearch/1.1/', 'xmlns:moz' => 'http://www.mozilla.org/2006/browser/search/') do
3 | xml.ShortName(t(:default_title))
4 | xml.InputEncoding('UTF-8')
5 | xml.Image("#{asset_url 'homescreen-icon-64x64.png'}", :height => '64', :width =>'64', :type =>'image/png')
6 | xml.Image("#{asset_url 'favicon.ico'}", :height => '16', :width =>'16', :type => 'image/x-icon')
7 | xml.Description(t(:opensearch_description))
8 | xml.Contact(t(:contact_email))
9 | xml.Url(type: 'text/html', method: 'get', template: root_url + '?q={searchTerms}' )
10 | xml.moz(:SearchForm, root_url)
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/quick_search/pages/about.html.erb:
--------------------------------------------------------------------------------
1 | <% title %>
2 |
3 |
4 |
About QuickSearch
5 |
QuickSearch, developed by NCSU Libraries, is a customized federated search tool designed to connect people to a variety of library resources, services, and tools. QuickSearch is designed to complement and increase use of existing dedicated library resource discovery tools, such as the catalog, electronic resource search, and subject guides/portals, by directing people to them via an intuitive search interface. The aim of QuickSearch is to provide people with a quick and easy way to find the information they need.
6 |
See the QuickSearch Project for technical details.
7 |
To provide feedback or to report a problem, please email the QuickSearch product team at quicksearch@lists.ncsu.edu.
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/views/quick_search/pages/home.html.erb:
--------------------------------------------------------------------------------
1 | <% title %>
2 | <%= render partial: '/layouts/quick_search/page_title', locals: { page_title: @page_title } %>
3 | <%= render partial: 'layouts/quick_search/search_form' %>
4 |
5 | <%= render partial: 'layouts/quick_search/common_searches' %>
6 |
7 |
--------------------------------------------------------------------------------
/app/views/quick_search/pages/realtime.html.erb:
--------------------------------------------------------------------------------
1 | <% title %>
2 |
3 |
4 |
Realtime Searches
5 |
What you see below is a stream of searches as they happen in real time.
6 |
11 |
12 |
13 |
14 | <%= javascript_include_tag File.join(QuickSearch::Engine::APP_CONFIG['realtime_url'], '/socket.io/socket.io.js') %>
15 | <%= javascript_include_tag 'realtime' %>
16 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_citation.html.erb:
--------------------------------------------------------------------------------
1 | <% if result.publisher %>
2 |
3 | <%= result.publisher %><%= result.volume || result.issue || result.pages ? ', ' : '.' %>
4 |
5 | <% end %>
6 | <% if result.volume %>
7 |
8 | <%= t 'citation_labels.volume' %> <%= result.volume %><%= result.issue || result.pages ? ', ' : '.' %>
9 |
10 | <% end %>
11 | <% if result.issue %>
12 |
13 | <%= t 'citation_labels.issue' %> <%= result.issue %><%= result.pages ? ', ' : '.' %>
14 |
15 | <% end %>
16 | <% if result.pages %>
17 |
<%= pages(result.pages).html_safe %>.
18 | <% end %>
--------------------------------------------------------------------------------
/app/views/quick_search/search/_date_display.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
<%= date.strftime("%b") %>
3 |
<%= date.day %>
4 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_module_with_paging.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <% if searcher.is_a? StandardError %>
3 | <% module_link = QuickSearch::Searcher.module_link_on_error(service_name, searcher, @query) %>
4 |
5 | <%= render partial: '/quick_search/search/search_error', locals: { service_name: service_name, page: page, template: 'with_paging', module_link: module_link } %>
6 | <% elsif searcher.results.blank? %>
7 | <%= render partial: '/quick_search/search/no_results', locals: { :service_name => service_name, searcher: searcher } %>
8 | <% else %>
9 | <% total = number_with_delimiter(searcher.total) %>
10 |
Page <%= page %> of <%= total %> <%= t("#{service_name}_search.short_display_name") %> results
11 |
12 | <%= render partial: '/quick_search/search/result', collection: searcher.results %>
13 |
14 | <%= paginate searcher.paging, :params => { :controller => 'search', :action => 'single_searcher', :searcher_name => service_name, :endpoint => nil, :template => nil, :format => nil }, :views_prefix => 'quick_search' %>
15 | <% end %>
16 |
17 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_no_results.html.erb:
--------------------------------------------------------------------------------
1 |
No <%= t("#{service_name}_search.short_display_name") %> results found for <%= display_query %>
2 |
3 | <%= link_to searcher.no_results_link(service_name, "#{service_name}_search.no_results_link"), data: {"quicksearch_ga_action" => "no-results"} do %>
4 | Try <%= t("#{service_name}_search.no_results_service_message") %>
5 | <% end %>
6 |
7 |
8 | <%= link_to searcher.no_results_link(service_name, "#{service_name}_search.no_results_link_mobile", "#{service_name}_search.no_results_link"), data: {"quicksearch_ga_action" => "no-results"} do %>
9 | Try <%= t("#{service_name}_search.no_results_service_message") %>
10 | <% end %>
11 |
12 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_result.html.erb:
--------------------------------------------------------------------------------
1 | <% if result["link"].instance_of?(String) %>
2 | <% unless result["link"].blank? or (result["link"].blank? and result["title"].blank?) %>
3 | <% if result["thumbnail"] %>
4 |
5 |
6 | <%= render partial: '/quick_search/search/result_with_thumbnail', locals: { result: result } %>
7 |
8 |
9 | <% else %>
10 |
11 |
12 | <%= render partial: '/quick_search/search/result_no_thumbnail', locals: { result: result } %>
13 |
14 |
15 | <% end %>
16 | <% end %>
17 | <% end %>
18 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_result_no_thumbnail.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= render partial: '/quick_search/search/result_details', locals: { result: result } %>
3 |
4 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_result_title.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to link do %>
2 | <%= truncate(sanitize(title), :length => 100, separator: ' ') %>
3 | <% end %>
4 | <% if local_assigns[:date_icon] && date_icon %>
5 | <%= render partial: "/quick_search/search/date_display", locals: { date: date_icon } %>
6 | <% end %>
7 |
<%= date %>
8 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_result_with_thumbnail.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= render partial: '/quick_search/search/result_details', locals: { result: result } %>
3 |
4 | <% imagealt = result['thumbnailalt'] ? result['thumbnailalt'] : result['title'] %>
5 | <% unless result["mobile_link"] %>
6 |
7 | <%= link_to result.link do %>
8 | <%= image_tag result["thumbnail"], :alt => imagealt, :class => 'thumbnail' %>
9 | <% end %>
10 |
11 | <% else %>
12 |
13 | <%= link_to result.link do %>
14 | <%= image_tag result["thumbnail"], :alt => imagealt, :class => 'thumbnail' %>
15 | <% end %>
16 |
17 |
18 | <%= link_to result.mobile_link do %>
19 | <%= image_tag result["thumbnail"], :alt => imagealt, :class => 'thumbnail' %>
20 | <% end %>
21 |
22 | <% end %>
23 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_search_error.html.erb:
--------------------------------------------------------------------------------
1 |
4 |
We're sorry. This search took too long.
5 |
6 | <%= link_to module_link, data: {"quicksearch_ga_action" => "error"} do %>
7 | Try <%= t("#{service_name}_search.error_service_message") %> for "<%= truncate(@query, length: 100, separator: ' ') %>"
8 | <% end %>
9 |
10 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_see_all.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to (module_link), :class => "see-all-results" do %>
2 | <% short_display_name = I18n.t("#{service_name}_search.short_display_name") %>
3 |
4 | <% if total == '1' %>
5 | <%= I18n.t("#{service_name}_search.see_all_message", :default => "See #{total} #{short_display_name} result") %>
6 | <% elsif total == '2' or total == '3' %>
7 | <%= I18n.t("#{service_name}_search.see_all_message", :default => "See #{total} #{short_display_name} results") %>
8 | <% else %>
9 | <%= I18n.t("#{service_name}_search.see_all_message", :default => "See all #{total} #{short_display_name} results") %>
10 | <% end %>
11 | <% end %>
--------------------------------------------------------------------------------
/app/views/quick_search/search/_xhr_response.html.erb:
--------------------------------------------------------------------------------
1 | <% if service_name == 'best_bets' %>
2 | <%= render partial: 'layouts/quick_search/best_bets', locals: { best_bets: searcher.results.first } %>
3 | <% elsif service_name == 'spelling_suggestion' %>
4 | <%= render partial: 'layouts/quick_search/spelling_suggestion', locals: { spelling_suggestion: searcher.spelling_suggestion } %>
5 | <% elsif service_name == 'related_topics' %>
6 | <%= render partial: 'layouts/quick_search/related_topics', locals: { related_topics: searcher.related_topics } %>
7 | <% elsif service_name == 'topic_snippet' %>
8 | <%= render partial: 'layouts/quick_search/topic_snippet', locals: { topic_snippet: searcher.topic_snippet } %>
9 | <% elsif service_name == 'smart_subjects' %>
10 | <% unless searcher.results.blank? %>
11 | <%= render_module(searcher, service_name) %>
12 | <% end %>
13 | <% else %>
14 | <%= render_module(searcher, service_name) %>
15 | <% end %>
16 |
--------------------------------------------------------------------------------
/app/views/quick_search/search/_xhr_response.json.erb:
--------------------------------------------------------------------------------
1 | <% if service_name == 'best_bets' %>
2 | <%= searcher.results.first %>
3 | <% elsif service_name == 'spelling_suggestion' %>
4 | <%= searcher.spelling_suggestion %>
5 | <% elsif service_name == 'related_topics' %>
6 | <%# searcher.related_topics.each do |topic| %>
7 | <%# topic %>
8 | <%# end %>
9 | <%= searcher.related_topics %>
10 | <% elsif service_name == 'topic_snippet' %>
11 | <%= searcher.topic_snippet %>
12 | <% else %>
13 | <%= searcher.results %>
14 | <% end %>
--------------------------------------------------------------------------------
/app/views/quick_search/search/_xhr_response_with_paging.html.erb:
--------------------------------------------------------------------------------
1 | <%= render_module(searcher, service_name, '/quick_search/search/module_with_paging') %>
2 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # This command will automatically be run when you run "rails" with Rails gems
3 | # installed from the root of your application.
4 |
5 | ENGINE_ROOT = File.expand_path('..', __dir__)
6 | ENGINE_PATH = File.expand_path('../lib/quick_search/engine', __dir__)
7 | APP_PATH = File.expand_path('../test/dummy/config/application', __dir__)
8 |
9 | # Set up gems listed in the Gemfile.
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
11 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
12 |
13 | require 'rails/all'
14 | require 'rails/engine/commands'
15 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run Rails.application
5 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | # Set up gems listed in the Gemfile.
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 |
4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5 |
--------------------------------------------------------------------------------
/config/database.yml.example:
--------------------------------------------------------------------------------
1 | # SQLite version 3.x
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem 'sqlite3'
6 | development:
7 | adapter: sqlite3
8 | database: db/development.sqlite3
9 | pool: 5
10 | timeout: 5000
11 |
12 | # Warning: The database defined as "test" will be erased and
13 | # re-generated from your development database when you run "rake".
14 | # Do not set this db to the same as development or production.
15 | test:
16 | adapter: sqlite3
17 | database: db/test.sqlite3
18 | pool: 5
19 | timeout: 5000
20 |
21 | staging:
22 | adapter: sqlite3
23 | database: db/production.sqlite3
24 | pool: 5
25 | timeout: 5000
26 |
27 | production:
28 | adapter: sqlite3
29 | database: db/production.sqlite3
30 | pool: 5
31 | timeout: 5000
32 |
--------------------------------------------------------------------------------
/config/initializers/words.rb:
--------------------------------------------------------------------------------
1 | words = File.join Rails.root, "/config/words.yml"
2 | DICTIONARY = YAML.load_file(words)
3 | SPELL_CHECKER = DidYouMean::SpellChecker.new(dictionary: DICTIONARY)
--------------------------------------------------------------------------------
/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more, please read the Rails Internationalization guide
20 | # available at http://guides.rubyonrails.org/i18n.html.
21 |
22 | en:
23 | call_to_try_searches: "Common searches"
24 | citation_labels:
25 | volume: 'Vol.'
26 | issue: 'Issue'
27 | page: 'p.'
28 | pages: 'pp.'
29 | best_bets_search:
30 | display_name: "Best Bet"
31 |
--------------------------------------------------------------------------------
/config/searchers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/config/searchers/.keep
--------------------------------------------------------------------------------
/config/words.yml:
--------------------------------------------------------------------------------
1 | - gopro
2 | - camera
--------------------------------------------------------------------------------
/db/migrate/20140130202859_create_events.rb:
--------------------------------------------------------------------------------
1 | class CreateEvents < ActiveRecord::Migration[4.2]
2 | def change
3 | create_table :events do |t|
4 | t.string :category
5 | t.string :action
6 | t.string :label
7 |
8 | t.timestamps
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20140130202944_create_searches.rb:
--------------------------------------------------------------------------------
1 | class CreateSearches < ActiveRecord::Migration[4.2]
2 | def change
3 | create_table :searches do |t|
4 | t.string :query
5 |
6 | t.timestamps
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20140225145441_add_page_to_searches.rb:
--------------------------------------------------------------------------------
1 | class AddPageToSearches < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :searches, :page, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20161201141003_create_sessions.rb:
--------------------------------------------------------------------------------
1 | class CreateSessions < ActiveRecord::Migration[5.0]
2 | def change
3 | create_table :sessions do |t|
4 | t.string :session_uuid
5 | t.datetime :expiry
6 | t.boolean :on_campus
7 | t.boolean :is_mobile
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20161201142811_change_event_columns.rb:
--------------------------------------------------------------------------------
1 | class ChangeEventColumns < ActiveRecord::Migration[5.0]
2 | def change
3 | change_table :events do |t|
4 | t.rename :action, :item
5 | t.rename :label, :query
6 | end
7 |
8 | add_column :events, :action, :string
9 | add_reference :events, :session, foreign_key: true
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20161201143901_add_session_id_to_searches.rb:
--------------------------------------------------------------------------------
1 | class AddSessionIdToSearches < ActiveRecord::Migration[5.0]
2 | def change
3 | add_reference :searches, :session, foreign_key: true
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20161212192454_add_date_string_columns.rb:
--------------------------------------------------------------------------------
1 | class AddDateStringColumns < ActiveRecord::Migration[5.0]
2 | def change
3 | add_column :events, :created_at_string, :string
4 | add_column :sessions, :created_at_string, :string
5 | add_column :searches, :created_at_string, :string
6 |
7 | add_index :events, :created_at_string
8 | add_index :sessions, :created_at_string
9 | add_index :searches, :created_at_string
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/schema.rb:
--------------------------------------------------------------------------------
1 | # encoding: UTF-8
2 | # This file is auto-generated from the current state of the database. Instead
3 | # of editing this file, please use the migrations feature of Active Record to
4 | # incrementally modify your database, and then regenerate this schema definition.
5 | #
6 | # Note that this schema.rb definition is the authoritative source for your
7 | # database schema. If you need to create the application database on another
8 | # system, you should be using db:schema:load, not running all the migrations
9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10 | # you'll amass, the slower it'll run and the greater likelihood for issues).
11 | #
12 | # It's strongly recommended that you check this file into your version control system.
13 |
14 | ActiveRecord::Schema.define(version: 20140225145441) do
15 |
16 | create_table "events", force: true do |t|
17 | t.string "category"
18 | t.string "action"
19 | t.string "label"
20 | t.datetime "created_at"
21 | t.datetime "updated_at"
22 | end
23 |
24 | create_table "searches", force: true do |t|
25 | t.string "query"
26 | t.datetime "created_at"
27 | t.datetime "updated_at"
28 | t.string "page"
29 | end
30 |
31 | end
32 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # QuickSearch Documentation
2 |
3 | This directory contains documentation for various features of
4 | QuickSearch, and also how to create/configure new themes, and searchers.
5 |
6 | ## Contents
7 |
8 | - [Configuration](configuration.md)
9 | - [Best Bets](best_bets.md)
10 | - [Statistics](statistics.md)
11 | - [Endpoints](endpoints.md)
12 | - [Customizing Searchers](customizing_searchers.md)
13 | - [Customizing Themes](customizing_themes.md)
14 | - [Configuring Good Bets](good_bets.md)
--------------------------------------------------------------------------------
/docs/best_bets.md:
--------------------------------------------------------------------------------
1 | # Best Bets
2 |
3 | QuickSearch includes a feature called “Best Bets”, which are high value, prominent, curated search results that appear for certain queries. You are able to specify these in a configuration file, that QuickSearch will then pick up. You are able to specify the keywords that trigger each Best Bet as well.
4 |
5 | To update Best Bets:
6 |
7 | - In the QuickSearch development environment edit the Best Bets file at [quicksearch_source_directory]/config/best_bets.yml
8 | - Be sure to list each keyword you want to match the Best Bet. These are matched exactly for shorter queries.
9 | - Run the following rake task from the command line:
10 |
11 | bundle exec rake best_bets:update_index
12 |
13 |
--------------------------------------------------------------------------------
/docs/customizing_themes.md:
--------------------------------------------------------------------------------
1 | # Customizing Themes
2 |
3 | ## Creating your own theme
4 |
5 | TODO
6 |
--------------------------------------------------------------------------------
/docs/good_bets.md:
--------------------------------------------------------------------------------
1 | # Good Bets
2 |
3 | ## What is Good Bets?
4 | Good Bets is a feature that will move bento results further up on the page as a third bento box. See attatched picture for an example. Good bets looks at the keyword and title fields and does a 75% match of searched terms to those fields. If the result is a 75% match it will consider the result a Good Bet. For example, if you search for "canon dslr camera rent". The only result you would get in the example is the first result because the words "canon", "dslr" and "camera" all appear in the title. The lack of the word "rent" creates a 75% match.
5 |
6 | 
7 |
8 | ## How to setup Good Bets
9 |
10 | 1. Go to your quicksearch_config.yml
11 | 2. Add the searchers you want to a field called `good_bets_searchers`. There you want to create a list similar to `searchers`. This list defines the searchers good bets will check the results for.
12 | ```
13 | good_bets_searchers: [website, smart_subjects, ematrix_database, ematrix_journal, lynda]
14 | ```
15 | 3. Add page_type_mapping (optional). By default the page_type field will be set to the name of the searcher repo. For example, if you have a `ematrix_journal` searcher good bets will display `Ematrix Journal` next to the good bet result. This might not be particularly clear to the user. You can add specific mappings for each searcher if you are unhappy with the displayed text. Add the name of the searcher and the displayed text like below.
16 |
17 | ```
18 | page_type_mapping: {'lynda': 'LinkedIn Learning', 'ematrix_journal': 'Journals', 'ematrix_database': 'Databases'}
19 | ```
--------------------------------------------------------------------------------
/docs/good_bets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/docs/good_bets.png
--------------------------------------------------------------------------------
/docs/statistics.md:
--------------------------------------------------------------------------------
1 | # Statistics
2 |
3 | QuickSearch collects usage statistics in a MySQL database for searches and clicks for every searcher that is included in your interface. It includes an interface where you can view these statistics as well at the following URL:
4 |
5 | http://path.to.quicksearch/appstats
6 |
7 | QuickSearch can also use Google Analytics to collect usage statistics. To use this feature, specify your Google Analytics tracking ID in the config/quick_search_config.yml file under the key “google_analytics_tracking_id”
8 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/lib/assets/.keep
--------------------------------------------------------------------------------
/lib/benchmark_logger.rb:
--------------------------------------------------------------------------------
1 | BenchmarkLogger = ActiveSupport::Logger.new(Rails.root.join('log/benchmark.log'))
2 | BenchmarkLogger.formatter = Logger::Formatter.new
3 |
--------------------------------------------------------------------------------
/lib/capistrano/tasks/access_check.cap:
--------------------------------------------------------------------------------
1 | desc "Check that we can access everything"
2 | task :check_write_permissions do
3 | on roles(:all) do |host|
4 | if test("[ -w #{fetch(:deploy_to)} ]")
5 | info "#{fetch(:deploy_to)} is writable on #{host}"
6 | else
7 | error "#{fetch(:deploy_to)} is not writable on #{host}"
8 | end
9 | end
10 | end
--------------------------------------------------------------------------------
/lib/generators/quick_search/templates/kaminari.rb:
--------------------------------------------------------------------------------
1 | Kaminari.configure do |config|
2 | # FIXME: This should be set per searcher in the main quicksearch config
3 | config.default_per_page = 20
4 | config.window = 3
5 | end
6 |
--------------------------------------------------------------------------------
/lib/generators/quick_search/templates/post_install.txt:
--------------------------------------------------------------------------------
1 |
2 | To add/remove/replace searchers:
3 |
4 | 1. Add searcher gems (see README for list of gems) to your project's Gemfile
5 | 2. Add a theme gem to Gemfile (see README)
6 | 3. Add the searchers/theme to quick_search_config.yml
7 | 4. Add render_module calls to search results view for each searcher
8 |
9 | For more information, see README and other documentation at http://github.com/ncsu-libraries/quick_search/
10 |
11 |
--------------------------------------------------------------------------------
/lib/quick_search-core.rb:
--------------------------------------------------------------------------------
1 | require "quick_search"
2 |
3 | module QuickSearch
4 | end
5 |
--------------------------------------------------------------------------------
/lib/quick_search.rb:
--------------------------------------------------------------------------------
1 | require "quick_search/engine"
2 |
3 | require "httpclient"
4 | require "kaminari"
5 | require "nokogiri"
6 | require "mysql2"
7 | require "jquery-rails"
8 |
9 | module QuickSearch
10 | end
11 |
--------------------------------------------------------------------------------
/lib/quick_search/version.rb:
--------------------------------------------------------------------------------
1 | module QuickSearch
2 | VERSION = "0.2.0"
3 | end
4 |
--------------------------------------------------------------------------------
/lib/searcher_error.rb:
--------------------------------------------------------------------------------
1 | # StandardError wrapper that enables the affected searcher to be specified
2 | module QuickSearch
3 | class SearcherError < StandardError
4 | attr_reader :searcher
5 |
6 | def initialize(e=nil, searcher)
7 | super e
8 | @searcher = searcher
9 | set_backtrace e.backtrace if e
10 | end
11 | end
12 | end
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/lib/tasks/.keep
--------------------------------------------------------------------------------
/lib/tasks/best_bets.rake:
--------------------------------------------------------------------------------
1 | namespace :best_bets do
2 | desc 'Update the BestBets SOLR index from best_bets.yml'
3 | task :update_index => :environment do
4 | require 'rsolr'
5 |
6 | best_bets_yaml = File.join Rails.root, "/config/best_bets.yml"
7 | best_bets = YAML.load_file(best_bets_yaml)['best_bets']
8 |
9 | solr = RSolr.connect :url => QuickSearch::Engine::APP_CONFIG['best_bets']['solr_url']
10 |
11 | solr.delete_by_query('*:*')
12 |
13 | records = []
14 |
15 | best_bets.each do |id, value|
16 | record = {
17 | :id => id,
18 | :title => value['title'],
19 | :url => value['url'],
20 | :description => value['description'],
21 | :keywords => value['keywords']
22 | }
23 | records << record
24 | end
25 |
26 | solr.add(records)
27 | solr.commit
28 |
29 | end
30 |
31 | end
32 |
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
The page you were looking for doesn't exist (404)
5 |
48 |
49 |
50 |
51 |
52 |
53 |
The page you were looking for doesn't exist.
54 |
You may have mistyped the address or the page may have moved.
55 |
56 |
If you are the application owner check the logs for more information.
57 |
58 |
59 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
The change you wanted was rejected (422)
5 |
48 |
49 |
50 |
51 |
52 |
53 |
The change you wanted was rejected.
54 |
Maybe you tried to change something you didn't have access to.
55 |
56 |
If you are the application owner check the logs for more information.
57 |
58 |
59 |
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
We're sorry, but something went wrong (500)
5 |
48 |
49 |
50 |
51 |
52 |
53 |
We're sorry, but something went wrong.
54 |
55 |
If you are the application owner check the logs for more information.
56 |
57 |
58 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/public/favicon.ico
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 |
5 | # Block all bots
6 | User-agent: *
7 | Disallow: /
8 |
--------------------------------------------------------------------------------
/quick_search-core.gemspec:
--------------------------------------------------------------------------------
1 | $:.push File.expand_path("../lib", __FILE__)
2 |
3 | # Maintain your gem's version:
4 | require "quick_search/version"
5 |
6 | # Describe your gem and declare its dependencies:
7 | Gem::Specification.new do |s|
8 | s.name = "quick_search-core"
9 | s.version = QuickSearch::VERSION
10 | s.authors = ["Kevin Beswick", "Nushrat Khan", "Cory Lown", "Jason Ronallo"]
11 | s.email = ["quicksearch@lists.ncsu.edu"]
12 | s.homepage = "http://www.github.com/ncsu-libraries/quick_search"
13 | s.summary = "QuickSearch is a toolkit for easily creating custom bento-box search applications"
14 | s.license = "MIT"
15 |
16 | s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
17 | s.test_files = Dir["test/**/*"]
18 |
19 | s.required_ruby_version = '>= 2.2.2'
20 |
21 | s.add_dependency "rails", "~> 6.1"
22 | s.add_dependency 'jquery-rails', '~> 4.3'
23 | s.add_dependency "kaminari"
24 | s.add_dependency "nokogiri"
25 | s.add_dependency "fastimage"
26 | s.add_dependency "mysql2"
27 | s.add_dependency "modernizr-rails"
28 | s.add_dependency "httpclient"
29 |
30 |
31 | end
32 |
--------------------------------------------------------------------------------
/solr_conf/_rest_managed.json:
--------------------------------------------------------------------------------
1 | {"initArgs":{},"managedList":[]}
2 |
--------------------------------------------------------------------------------
/solr_conf/elevate.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/solr_conf/lang/contractions_ca.txt:
--------------------------------------------------------------------------------
1 | # Set of Catalan contractions for ElisionFilter
2 | # TODO: load this as a resource from the analyzer and sync it in build.xml
3 | d
4 | l
5 | m
6 | n
7 | s
8 | t
9 |
--------------------------------------------------------------------------------
/solr_conf/lang/contractions_fr.txt:
--------------------------------------------------------------------------------
1 | # Set of French contractions for ElisionFilter
2 | # TODO: load this as a resource from the analyzer and sync it in build.xml
3 | l
4 | m
5 | t
6 | qu
7 | n
8 | s
9 | j
10 |
--------------------------------------------------------------------------------
/solr_conf/lang/contractions_it.txt:
--------------------------------------------------------------------------------
1 | # Set of Italian contractions for ElisionFilter
2 | # TODO: load this as a resource from the analyzer and sync it in build.xml
3 | c
4 | l
5 | all
6 | dall
7 | dell
8 | nell
9 | sull
10 | coll
11 | pell
12 | gl
13 | agl
14 | dagl
15 | degl
16 | negl
17 | sugl
18 | un
19 | m
20 | t
21 | s
22 | v
23 | d
24 |
--------------------------------------------------------------------------------
/solr_conf/lang/stemdict_nl.txt:
--------------------------------------------------------------------------------
1 | # Set of overrides for the dutch stemmer
2 | # TODO: load this as a resource from the analyzer and sync it in build.xml
3 | fiets fiets
4 | bromfiets bromfiets
5 | ei eier
6 | kind kinder
7 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_ar.txt:
--------------------------------------------------------------------------------
1 | # This file was created by Jacques Savoy and is distributed under the BSD license.
2 | # See http://members.unine.ch/jacques.savoy/clef/index.html.
3 | # Also see http://www.opensource.org/licenses/bsd-license.html
4 | # Cleaned on October 11, 2009 (not normalized, so use before normalization)
5 | # This means that when modifying this list, you might need to add some
6 | # redundant entries, for example containing forms with both أ and ا
7 | من
8 | ومن
9 | منها
10 | منه
11 | في
12 | وفي
13 | فيها
14 | فيه
15 | و
16 | ف
17 | ثم
18 | او
19 | أو
20 | ب
21 | بها
22 | به
23 | ا
24 | أ
25 | اى
26 | اي
27 | أي
28 | أى
29 | لا
30 | ولا
31 | الا
32 | ألا
33 | إلا
34 | لكن
35 | ما
36 | وما
37 | كما
38 | فما
39 | عن
40 | مع
41 | اذا
42 | إذا
43 | ان
44 | أن
45 | إن
46 | انها
47 | أنها
48 | إنها
49 | انه
50 | أنه
51 | إنه
52 | بان
53 | بأن
54 | فان
55 | فأن
56 | وان
57 | وأن
58 | وإن
59 | التى
60 | التي
61 | الذى
62 | الذي
63 | الذين
64 | الى
65 | الي
66 | إلى
67 | إلي
68 | على
69 | عليها
70 | عليه
71 | اما
72 | أما
73 | إما
74 | ايضا
75 | أيضا
76 | كل
77 | وكل
78 | لم
79 | ولم
80 | لن
81 | ولن
82 | هى
83 | هي
84 | هو
85 | وهى
86 | وهي
87 | وهو
88 | فهى
89 | فهي
90 | فهو
91 | انت
92 | أنت
93 | لك
94 | لها
95 | له
96 | هذه
97 | هذا
98 | تلك
99 | ذلك
100 | هناك
101 | كانت
102 | كان
103 | يكون
104 | تكون
105 | وكانت
106 | وكان
107 | غير
108 | بعض
109 | قد
110 | نحو
111 | بين
112 | بينما
113 | منذ
114 | ضمن
115 | حيث
116 | الان
117 | الآن
118 | خلال
119 | بعد
120 | قبل
121 | حتى
122 | عند
123 | عندما
124 | لدى
125 | جميع
126 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_cz.txt:
--------------------------------------------------------------------------------
1 | a
2 | s
3 | k
4 | o
5 | i
6 | u
7 | v
8 | z
9 | dnes
10 | cz
11 | tímto
12 | budeš
13 | budem
14 | byli
15 | jseš
16 | můj
17 | svým
18 | ta
19 | tomto
20 | tohle
21 | tuto
22 | tyto
23 | jej
24 | zda
25 | proč
26 | máte
27 | tato
28 | kam
29 | tohoto
30 | kdo
31 | kteří
32 | mi
33 | nám
34 | tom
35 | tomuto
36 | mít
37 | nic
38 | proto
39 | kterou
40 | byla
41 | toho
42 | protože
43 | asi
44 | ho
45 | naši
46 | napište
47 | re
48 | což
49 | tím
50 | takže
51 | svých
52 | její
53 | svými
54 | jste
55 | aj
56 | tu
57 | tedy
58 | teto
59 | bylo
60 | kde
61 | ke
62 | pravé
63 | ji
64 | nad
65 | nejsou
66 | či
67 | pod
68 | téma
69 | mezi
70 | přes
71 | ty
72 | pak
73 | vám
74 | ani
75 | když
76 | však
77 | neg
78 | jsem
79 | tento
80 | článku
81 | články
82 | aby
83 | jsme
84 | před
85 | pta
86 | jejich
87 | byl
88 | ještě
89 | až
90 | bez
91 | také
92 | pouze
93 | první
94 | vaše
95 | která
96 | nás
97 | nový
98 | tipy
99 | pokud
100 | může
101 | strana
102 | jeho
103 | své
104 | jiné
105 | zprávy
106 | nové
107 | není
108 | vás
109 | jen
110 | podle
111 | zde
112 | už
113 | být
114 | více
115 | bude
116 | již
117 | než
118 | který
119 | by
120 | které
121 | co
122 | nebo
123 | ten
124 | tak
125 | má
126 | při
127 | od
128 | po
129 | jsou
130 | jak
131 | další
132 | ale
133 | si
134 | se
135 | ve
136 | to
137 | jako
138 | za
139 | zpět
140 | ze
141 | do
142 | pro
143 | je
144 | na
145 | atd
146 | atp
147 | jakmile
148 | přičemž
149 | já
150 | on
151 | ona
152 | ono
153 | oni
154 | ony
155 | my
156 | vy
157 | jí
158 | ji
159 | mě
160 | mne
161 | jemu
162 | tomu
163 | těm
164 | těmu
165 | němu
166 | němuž
167 | jehož
168 | jíž
169 | jelikož
170 | jež
171 | jakož
172 | načež
173 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_el.txt:
--------------------------------------------------------------------------------
1 | # Lucene Greek Stopwords list
2 | # Note: by default this file is used after GreekLowerCaseFilter,
3 | # so when modifying this file use 'σ' instead of 'ς'
4 | ο
5 | η
6 | το
7 | οι
8 | τα
9 | του
10 | τησ
11 | των
12 | τον
13 | την
14 | και
15 | κι
16 | κ
17 | ειμαι
18 | εισαι
19 | ειναι
20 | ειμαστε
21 | ειστε
22 | στο
23 | στον
24 | στη
25 | στην
26 | μα
27 | αλλα
28 | απο
29 | για
30 | προσ
31 | με
32 | σε
33 | ωσ
34 | παρα
35 | αντι
36 | κατα
37 | μετα
38 | θα
39 | να
40 | δε
41 | δεν
42 | μη
43 | μην
44 | επι
45 | ενω
46 | εαν
47 | αν
48 | τοτε
49 | που
50 | πωσ
51 | ποιοσ
52 | ποια
53 | ποιο
54 | ποιοι
55 | ποιεσ
56 | ποιων
57 | ποιουσ
58 | αυτοσ
59 | αυτη
60 | αυτο
61 | αυτοι
62 | αυτων
63 | αυτουσ
64 | αυτεσ
65 | αυτα
66 | εκεινοσ
67 | εκεινη
68 | εκεινο
69 | εκεινοι
70 | εκεινεσ
71 | εκεινα
72 | εκεινων
73 | εκεινουσ
74 | οπωσ
75 | ομωσ
76 | ισωσ
77 | οσο
78 | οτι
79 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_en.txt:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | # a couple of test stopwords to test that the words are really being
17 | # configured from this file:
18 | stopworda
19 | stopwordb
20 |
21 | # Standard english stop words taken from Lucene's StopAnalyzer
22 | a
23 | an
24 | and
25 | are
26 | as
27 | at
28 | be
29 | but
30 | by
31 | for
32 | if
33 | in
34 | into
35 | is
36 | it
37 | no
38 | not
39 | of
40 | on
41 | or
42 | such
43 | that
44 | the
45 | their
46 | then
47 | there
48 | these
49 | they
50 | this
51 | to
52 | was
53 | will
54 | with
55 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_eu.txt:
--------------------------------------------------------------------------------
1 | # example set of basque stopwords
2 | al
3 | anitz
4 | arabera
5 | asko
6 | baina
7 | bat
8 | batean
9 | batek
10 | bati
11 | batzuei
12 | batzuek
13 | batzuetan
14 | batzuk
15 | bera
16 | beraiek
17 | berau
18 | berauek
19 | bere
20 | berori
21 | beroriek
22 | beste
23 | bezala
24 | da
25 | dago
26 | dira
27 | ditu
28 | du
29 | dute
30 | edo
31 | egin
32 | ere
33 | eta
34 | eurak
35 | ez
36 | gainera
37 | gu
38 | gutxi
39 | guzti
40 | haiei
41 | haiek
42 | haietan
43 | hainbeste
44 | hala
45 | han
46 | handik
47 | hango
48 | hara
49 | hari
50 | hark
51 | hartan
52 | hau
53 | hauei
54 | hauek
55 | hauetan
56 | hemen
57 | hemendik
58 | hemengo
59 | hi
60 | hona
61 | honek
62 | honela
63 | honetan
64 | honi
65 | hor
66 | hori
67 | horiei
68 | horiek
69 | horietan
70 | horko
71 | horra
72 | horrek
73 | horrela
74 | horretan
75 | horri
76 | hortik
77 | hura
78 | izan
79 | ni
80 | noiz
81 | nola
82 | non
83 | nondik
84 | nongo
85 | nor
86 | nora
87 | ze
88 | zein
89 | zen
90 | zenbait
91 | zenbat
92 | zer
93 | zergatik
94 | ziren
95 | zituen
96 | zu
97 | zuek
98 | zuen
99 | zuten
100 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_gl.txt:
--------------------------------------------------------------------------------
1 | # galican stopwords
2 | a
3 | aínda
4 | alí
5 | aquel
6 | aquela
7 | aquelas
8 | aqueles
9 | aquilo
10 | aquí
11 | ao
12 | aos
13 | as
14 | así
15 | á
16 | ben
17 | cando
18 | che
19 | co
20 | coa
21 | comigo
22 | con
23 | connosco
24 | contigo
25 | convosco
26 | coas
27 | cos
28 | cun
29 | cuns
30 | cunha
31 | cunhas
32 | da
33 | dalgunha
34 | dalgunhas
35 | dalgún
36 | dalgúns
37 | das
38 | de
39 | del
40 | dela
41 | delas
42 | deles
43 | desde
44 | deste
45 | do
46 | dos
47 | dun
48 | duns
49 | dunha
50 | dunhas
51 | e
52 | el
53 | ela
54 | elas
55 | eles
56 | en
57 | era
58 | eran
59 | esa
60 | esas
61 | ese
62 | eses
63 | esta
64 | estar
65 | estaba
66 | está
67 | están
68 | este
69 | estes
70 | estiven
71 | estou
72 | eu
73 | é
74 | facer
75 | foi
76 | foron
77 | fun
78 | había
79 | hai
80 | iso
81 | isto
82 | la
83 | las
84 | lle
85 | lles
86 | lo
87 | los
88 | mais
89 | me
90 | meu
91 | meus
92 | min
93 | miña
94 | miñas
95 | moi
96 | na
97 | nas
98 | neste
99 | nin
100 | no
101 | non
102 | nos
103 | nosa
104 | nosas
105 | noso
106 | nosos
107 | nós
108 | nun
109 | nunha
110 | nuns
111 | nunhas
112 | o
113 | os
114 | ou
115 | ó
116 | ós
117 | para
118 | pero
119 | pode
120 | pois
121 | pola
122 | polas
123 | polo
124 | polos
125 | por
126 | que
127 | se
128 | senón
129 | ser
130 | seu
131 | seus
132 | sexa
133 | sido
134 | sobre
135 | súa
136 | súas
137 | tamén
138 | tan
139 | te
140 | ten
141 | teñen
142 | teño
143 | ter
144 | teu
145 | teus
146 | ti
147 | tido
148 | tiña
149 | tiven
150 | túa
151 | túas
152 | un
153 | unha
154 | unhas
155 | uns
156 | vos
157 | vosa
158 | vosas
159 | voso
160 | vosos
161 | vós
162 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_hy.txt:
--------------------------------------------------------------------------------
1 | # example set of Armenian stopwords.
2 | այդ
3 | այլ
4 | այն
5 | այս
6 | դու
7 | դուք
8 | եմ
9 | են
10 | ենք
11 | ես
12 | եք
13 | է
14 | էի
15 | էին
16 | էինք
17 | էիր
18 | էիք
19 | էր
20 | ըստ
21 | թ
22 | ի
23 | ին
24 | իսկ
25 | իր
26 | կամ
27 | համար
28 | հետ
29 | հետո
30 | մենք
31 | մեջ
32 | մի
33 | ն
34 | նա
35 | նաև
36 | նրա
37 | նրանք
38 | որ
39 | որը
40 | որոնք
41 | որպես
42 | ու
43 | ում
44 | պիտի
45 | վրա
46 | և
47 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_ja.txt:
--------------------------------------------------------------------------------
1 | #
2 | # This file defines a stopword set for Japanese.
3 | #
4 | # This set is made up of hand-picked frequent terms from segmented Japanese Wikipedia.
5 | # Punctuation characters and frequent kanji have mostly been left out. See LUCENE-3745
6 | # for frequency lists, etc. that can be useful for making your own set (if desired)
7 | #
8 | # Note that there is an overlap between these stopwords and the terms stopped when used
9 | # in combination with the KuromojiPartOfSpeechStopFilter. When editing this file, note
10 | # that comments are not allowed on the same line as stopwords.
11 | #
12 | # Also note that stopping is done in a case-insensitive manner. Change your StopFilter
13 | # configuration if you need case-sensitive stopping. Lastly, note that stopping is done
14 | # using the same character width as the entries in this file. Since this StopFilter is
15 | # normally done after a CJKWidthFilter in your chain, you would usually want your romaji
16 | # entries to be in half-width and your kana entries to be in full-width.
17 | #
18 | の
19 | に
20 | は
21 | を
22 | た
23 | が
24 | で
25 | て
26 | と
27 | し
28 | れ
29 | さ
30 | ある
31 | いる
32 | も
33 | する
34 | から
35 | な
36 | こと
37 | として
38 | い
39 | や
40 | れる
41 | など
42 | なっ
43 | ない
44 | この
45 | ため
46 | その
47 | あっ
48 | よう
49 | また
50 | もの
51 | という
52 | あり
53 | まで
54 | られ
55 | なる
56 | へ
57 | か
58 | だ
59 | これ
60 | によって
61 | により
62 | おり
63 | より
64 | による
65 | ず
66 | なり
67 | られる
68 | において
69 | ば
70 | なかっ
71 | なく
72 | しかし
73 | について
74 | せ
75 | だっ
76 | その後
77 | できる
78 | それ
79 | う
80 | ので
81 | なお
82 | のみ
83 | でき
84 | き
85 | つ
86 | における
87 | および
88 | いう
89 | さらに
90 | でも
91 | ら
92 | たり
93 | その他
94 | に関する
95 | たち
96 | ます
97 | ん
98 | なら
99 | に対して
100 | 特に
101 | せる
102 | 及び
103 | これら
104 | とき
105 | では
106 | にて
107 | ほか
108 | ながら
109 | うち
110 | そして
111 | とともに
112 | ただし
113 | かつて
114 | それぞれ
115 | または
116 | お
117 | ほど
118 | ものの
119 | に対する
120 | ほとんど
121 | と共に
122 | といった
123 | です
124 | とも
125 | ところ
126 | ここ
127 | ##### End of file
128 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_lv.txt:
--------------------------------------------------------------------------------
1 | # Set of Latvian stopwords from A Stemming Algorithm for Latvian, Karlis Kreslins
2 | # the original list of over 800 forms was refined:
3 | # pronouns, adverbs, interjections were removed
4 | #
5 | # prepositions
6 | aiz
7 | ap
8 | ar
9 | apakš
10 | ārpus
11 | augšpus
12 | bez
13 | caur
14 | dēļ
15 | gar
16 | iekš
17 | iz
18 | kopš
19 | labad
20 | lejpus
21 | līdz
22 | no
23 | otrpus
24 | pa
25 | par
26 | pār
27 | pēc
28 | pie
29 | pirms
30 | pret
31 | priekš
32 | starp
33 | šaipus
34 | uz
35 | viņpus
36 | virs
37 | virspus
38 | zem
39 | apakšpus
40 | # Conjunctions
41 | un
42 | bet
43 | jo
44 | ja
45 | ka
46 | lai
47 | tomēr
48 | tikko
49 | turpretī
50 | arī
51 | kaut
52 | gan
53 | tādēļ
54 | tā
55 | ne
56 | tikvien
57 | vien
58 | kā
59 | ir
60 | te
61 | vai
62 | kamēr
63 | # Particles
64 | ar
65 | diezin
66 | droši
67 | diemžēl
68 | nebūt
69 | ik
70 | it
71 | taču
72 | nu
73 | pat
74 | tiklab
75 | iekšpus
76 | nedz
77 | tik
78 | nevis
79 | turpretim
80 | jeb
81 | iekam
82 | iekām
83 | iekāms
84 | kolīdz
85 | līdzko
86 | tiklīdz
87 | jebšu
88 | tālab
89 | tāpēc
90 | nekā
91 | itin
92 | jā
93 | jau
94 | jel
95 | nē
96 | nezin
97 | tad
98 | tikai
99 | vis
100 | tak
101 | iekams
102 | vien
103 | # modal verbs
104 | būt
105 | biju
106 | biji
107 | bija
108 | bijām
109 | bijāt
110 | esmu
111 | esi
112 | esam
113 | esat
114 | būšu
115 | būsi
116 | būs
117 | būsim
118 | būsiet
119 | tikt
120 | tiku
121 | tiki
122 | tika
123 | tikām
124 | tikāt
125 | tieku
126 | tiec
127 | tiek
128 | tiekam
129 | tiekat
130 | tikšu
131 | tiks
132 | tiksim
133 | tiksiet
134 | tapt
135 | tapi
136 | tapāt
137 | topat
138 | tapšu
139 | tapsi
140 | taps
141 | tapsim
142 | tapsiet
143 | kļūt
144 | kļuvu
145 | kļuvi
146 | kļuva
147 | kļuvām
148 | kļuvāt
149 | kļūstu
150 | kļūsti
151 | kļūst
152 | kļūstam
153 | kļūstat
154 | kļūšu
155 | kļūsi
156 | kļūs
157 | kļūsim
158 | kļūsiet
159 | # verbs
160 | varēt
161 | varēju
162 | varējām
163 | varēšu
164 | varēsim
165 | var
166 | varēji
167 | varējāt
168 | varēsi
169 | varēsiet
170 | varat
171 | varēja
172 | varēs
173 |
--------------------------------------------------------------------------------
/solr_conf/lang/stopwords_th.txt:
--------------------------------------------------------------------------------
1 | # Thai stopwords from:
2 | # "Opinion Detection in Thai Political News Columns
3 | # Based on Subjectivity Analysis"
4 | # Khampol Sukhum, Supot Nitsuwat, and Choochart Haruechaiyasak
5 | ไว้
6 | ไม่
7 | ไป
8 | ได้
9 | ให้
10 | ใน
11 | โดย
12 | แห่ง
13 | แล้ว
14 | และ
15 | แรก
16 | แบบ
17 | แต่
18 | เอง
19 | เห็น
20 | เลย
21 | เริ่ม
22 | เรา
23 | เมื่อ
24 | เพื่อ
25 | เพราะ
26 | เป็นการ
27 | เป็น
28 | เปิดเผย
29 | เปิด
30 | เนื่องจาก
31 | เดียวกัน
32 | เดียว
33 | เช่น
34 | เฉพาะ
35 | เคย
36 | เข้า
37 | เขา
38 | อีก
39 | อาจ
40 | อะไร
41 | ออก
42 | อย่าง
43 | อยู่
44 | อยาก
45 | หาก
46 | หลาย
47 | หลังจาก
48 | หลัง
49 | หรือ
50 | หนึ่ง
51 | ส่วน
52 | ส่ง
53 | สุด
54 | สําหรับ
55 | ว่า
56 | วัน
57 | ลง
58 | ร่วม
59 | ราย
60 | รับ
61 | ระหว่าง
62 | รวม
63 | ยัง
64 | มี
65 | มาก
66 | มา
67 | พร้อม
68 | พบ
69 | ผ่าน
70 | ผล
71 | บาง
72 | น่า
73 | นี้
74 | นํา
75 | นั้น
76 | นัก
77 | นอกจาก
78 | ทุก
79 | ที่สุด
80 | ที่
81 | ทําให้
82 | ทํา
83 | ทาง
84 | ทั้งนี้
85 | ทั้ง
86 | ถ้า
87 | ถูก
88 | ถึง
89 | ต้อง
90 | ต่างๆ
91 | ต่าง
92 | ต่อ
93 | ตาม
94 | ตั้งแต่
95 | ตั้ง
96 | ด้าน
97 | ด้วย
98 | ดัง
99 | ซึ่ง
100 | ช่วง
101 | จึง
102 | จาก
103 | จัด
104 | จะ
105 | คือ
106 | ความ
107 | ครั้ง
108 | คง
109 | ขึ้น
110 | ของ
111 | ขอ
112 | ขณะ
113 | ก่อน
114 | ก็
115 | การ
116 | กับ
117 | กัน
118 | กว่า
119 | กล่าว
120 |
--------------------------------------------------------------------------------
/solr_conf/protwords.txt:
--------------------------------------------------------------------------------
1 | # The ASF licenses this file to You under the Apache License, Version 2.0
2 | # (the "License"); you may not use this file except in compliance with
3 | # the License. You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 |
13 | #-----------------------------------------------------------------------
14 | # Use a protected word file to protect against the stemmer reducing two
15 | # unrelated words to the same base word.
16 |
17 | # Some non-words that normally won't be encountered,
18 | # just to test that they won't be stemmed.
19 | dontstems
20 | zwhacky
21 |
22 |
--------------------------------------------------------------------------------
/solr_conf/stopwords.txt:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | a
17 | an
18 | and
19 | are
20 | as
21 | at
22 | be
23 | but
24 | by
25 | for
26 | if
27 | in
28 | into
29 | is
30 | it
31 | no
32 | not
33 | of
34 | on
35 | or
36 | s
37 | such
38 | t
39 | that
40 | the
41 | their
42 | then
43 | there
44 | these
45 | they
46 | this
47 | to
48 | was
49 | will
50 | with
51 |
--------------------------------------------------------------------------------
/solr_conf/stopwords_en.txt:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | # a couple of test stopwords to test that the words are really being
17 | # configured from this file:
18 | stopworda
19 | stopwordb
20 |
21 | # Standard english stop words taken from Lucene's StopAnalyzer
22 | a
23 | an
24 | and
25 | are
26 | as
27 | at
28 | be
29 | but
30 | by
31 | for
32 | if
33 | in
34 | into
35 | is
36 | it
37 | no
38 | not
39 | of
40 | on
41 | or
42 | such
43 | that
44 | the
45 | their
46 | then
47 | there
48 | these
49 | they
50 | this
51 | to
52 | was
53 | will
54 | with
55 |
--------------------------------------------------------------------------------
/solr_conf/synonyms.txt:
--------------------------------------------------------------------------------
1 | # The ASF licenses this file to You under the Apache License, Version 2.0
2 | # (the "License"); you may not use this file except in compliance with
3 | # the License. You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 |
13 | #-----------------------------------------------------------------------
14 | #some test synonym mappings unlikely to appear in real input text
15 | aaafoo => aaabar
16 | bbbfoo => bbbfoo bbbbar
17 | cccfoo => cccbar cccbaz
18 | fooaaa,baraaa,bazaaa
19 |
20 | # Some synonym groups specific to this example
21 | GB,gib,gigabyte,gigabytes
22 | MB,mib,megabyte,megabytes
23 | Television, Televisions, TV, TVs
24 | #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
25 | #after us won't split it into two words.
26 |
27 | # Synonym mappings can be used for spelling correction too
28 | pixima => pixma
29 |
30 |
--------------------------------------------------------------------------------
/solr_conf/velocity/browse.vm:
--------------------------------------------------------------------------------
1 | #set($searcher=$request.searcher)
2 | #set($params=$request.params)
3 | #set($clusters = $response.response.clusters)
4 | #set($mltResults = $response.response.get("moreLikeThis"))
5 | #set($annotate = $params.get("annotateBrowse"))
6 | #parse('query.vm')
7 | #if($response.response.spellcheck.suggestions and $response.response.spellcheck.suggestions.size() > 0)
8 | Did you mean
$response.response.spellcheck.suggestions.collation?
9 | #end
10 |
11 |
12 | #parse("facets.vm")
13 |
14 |
15 |
22 |
23 |
24 | #if($response.response.get('grouped'))
25 | #foreach($grouping in $response.response.get('grouped'))
26 | #parse("hitGrouped.vm")
27 | #end
28 | #else
29 | #foreach($doc in $response.results)
30 | #parse("hit.vm")
31 | #end
32 | #end
33 |
34 |
35 |
46 |
--------------------------------------------------------------------------------
/solr_conf/velocity/cluster.vm:
--------------------------------------------------------------------------------
1 |
Clusters
2 |
3 | Run Solr with java -Dsolr.clustering.enabled=true -jar start.jar to see results
4 |
5 |
10 |
--------------------------------------------------------------------------------
/solr_conf/velocity/clusterResults.vm:
--------------------------------------------------------------------------------
1 | #foreach ($clusters in $response.response.clusters)
2 | #set($labels = $clusters.get('labels'))
3 | #set($docs = $clusters.get('docs'))
4 |
#foreach ($label in $labels)$label#if( $foreach.hasNext ),#end#end
5 |
6 | #foreach ($cluDoc in $docs)
7 | - $cluDoc
8 | #end
9 |
10 |
11 |
12 | #end
--------------------------------------------------------------------------------
/solr_conf/velocity/doc.vm:
--------------------------------------------------------------------------------
1 |
#field('name')#if($params.getBool('mlt', false) == false)More Like This#end
2 | ##do we have a physical store for this product
3 | #set($store = $doc.getFieldValue('store'))
4 | #if($store)
#end
5 |
Price: $!number.currency($doc.getFieldValue('price'))
6 |
Features: #field('features')
7 |
In Stock: #field('inStock')
8 |
9 | #set($mlt = $mltResults.get($docId))
10 | #set($mltOn = $params.getBool('mlt'))
11 | #if($mltOn == true)
Similar Items
#end
12 | #if ($mltOn && $mlt && $mlt.size() > 0)
13 |
22 | #elseif($mltOn && $mlt.size() == 0)
23 |
No Similar Items Found
24 | #end
25 |
26 | #if($params.getBool("debugQuery",false))
27 |
toggle explain
28 |
$response.getExplainMap().get($doc.getFirstValue('id'))
29 |
toggle all fields
30 |
31 | #foreach($fieldname in $doc.fieldNames)
32 |
33 | $fieldname :
34 |
35 | #foreach($value in $doc.getFieldValues($fieldname))
36 | $value
37 | #end
38 |
39 | #end
40 |
41 |
42 | #end
--------------------------------------------------------------------------------
/solr_conf/velocity/facet_fields.vm:
--------------------------------------------------------------------------------
1 | #if($response.facetFields)
2 |
Field Facets
3 | #foreach($field in $response.facetFields)
4 |
$field.name
5 |
6 |
7 | #foreach($facet in $field.values)
8 | - $facet.name ($facet.count)
9 | #end
10 |
11 | #end
12 | #end
--------------------------------------------------------------------------------
/solr_conf/velocity/facet_pivot.vm:
--------------------------------------------------------------------------------
1 |
Pivot Facets
2 | #set($pivot = $response.response.facet_counts.facet_pivot)
3 | #display_facet_pivot($pivot, "")
4 |
--------------------------------------------------------------------------------
/solr_conf/velocity/facet_queries.vm:
--------------------------------------------------------------------------------
1 | #set($field = $response.response.facet_counts.facet_queries)
2 |
Query Facets
3 | #display_facet_query($field, "", "")
--------------------------------------------------------------------------------
/solr_conf/velocity/facet_ranges.vm:
--------------------------------------------------------------------------------
1 |
Range Facets
2 | #foreach ($field in $response.response.facet_counts.facet_ranges)
3 | #set($name = $field.key)
4 | #set($display = $name)
5 | #set($f = $field.value.counts)
6 | #set($start = $field.value.start)
7 | #set($end = $field.value.end)
8 | #set($gap = $field.value.gap)
9 | #set($before = $field.value.before)
10 | #set($after = $field.value.after)
11 | #display_facet_range($f, $display, $name, $start, $end, $gap, $before, $after)
12 | #end
--------------------------------------------------------------------------------
/solr_conf/velocity/facets.vm:
--------------------------------------------------------------------------------
1 | #parse('facet_fields.vm')
2 | #parse('facet_queries.vm')
3 | #parse('facet_ranges.vm')
4 | #parse('facet_pivot.vm')
5 | #parse('cluster.vm')
--------------------------------------------------------------------------------
/solr_conf/velocity/footer.vm:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
Disclaimer: The locations displayed in this demonstration are purely fictional. It is more than likely that no store with the items listed actually exists at that location!
--------------------------------------------------------------------------------
/solr_conf/velocity/head.vm:
--------------------------------------------------------------------------------
1 |
2 | ## An example of using an arbitrary request parameter
3 |
#param('title')
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/solr_conf/velocity/header.vm:
--------------------------------------------------------------------------------
1 |
2 |

3 |
--------------------------------------------------------------------------------
/solr_conf/velocity/hit.vm:
--------------------------------------------------------------------------------
1 | #set($docId = $doc.getFieldValue('id'))
2 |
3 |
4 | #parse("doc.vm")
5 |
6 |
--------------------------------------------------------------------------------
/solr_conf/velocity/hitGrouped.vm:
--------------------------------------------------------------------------------
1 |
2 |
$grouping.key
3 |
Total Matches in Group: $grouping.value.matches
4 |
#foreach ($group in $grouping.value.groups)
5 |
$group.groupValue ($group.doclist.numFound)
6 |
7 | #foreach ($doc in $group.doclist)
8 | #set($docId = $doc.getFieldValue('id'))
9 | #parse("doc.vm")
10 | #end
11 |
12 | #end
13 |
14 | #if($params.getBool("debugQuery",false))
15 |
toggle explain
16 |
$response.getExplainMap().get($doc.getFirstValue('id'))
17 | #end
18 |
19 |
--------------------------------------------------------------------------------
/solr_conf/velocity/index.html:
--------------------------------------------------------------------------------
1 |
32 |
--------------------------------------------------------------------------------
/solr_conf/velocity/jquery.autocomplete.css:
--------------------------------------------------------------------------------
1 | .ac_results {
2 | padding: 0px;
3 | border: 1px solid black;
4 | background-color: white;
5 | overflow: hidden;
6 | z-index: 99999;
7 | }
8 |
9 | .ac_results ul {
10 | width: 100%;
11 | list-style-position: outside;
12 | list-style: none;
13 | padding: 0;
14 | margin: 0;
15 | }
16 |
17 | .ac_results li {
18 | margin: 0px;
19 | padding: 2px 5px;
20 | cursor: default;
21 | display: block;
22 | /*
23 | if width will be 100% horizontal scrollbar will apear
24 | when scroll mode will be used
25 | */
26 | /*width: 100%;*/
27 | font: menu;
28 | font-size: 12px;
29 | /*
30 | it is very important, if line-height not setted or setted
31 | in relative units scroll will be broken in firefox
32 | */
33 | line-height: 16px;
34 | overflow: hidden;
35 | }
36 |
37 | .ac_loading {
38 | background: white url('indicator.gif') right center no-repeat;
39 | }
40 |
41 | .ac_odd {
42 | background-color: #eee;
43 | }
44 |
45 | .ac_over {
46 | background-color: #0A246A;
47 | color: white;
48 | }
49 |
--------------------------------------------------------------------------------
/solr_conf/velocity/layout.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 | #parse("head.vm")
4 |
5 |
6 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/solr_conf/velocity/query.vm:
--------------------------------------------------------------------------------
1 |
43 |
--------------------------------------------------------------------------------
/solr_conf/velocity/queryGroup.vm:
--------------------------------------------------------------------------------
1 | #set($queryOpts = $params.get("queryOpts"))
2 | #if($queryOpts == "group")
3 |
18 |
19 | #end
--------------------------------------------------------------------------------
/solr_conf/velocity/querySpatial.vm:
--------------------------------------------------------------------------------
1 | #set($queryOpts = $params.get("queryOpts"))
2 | #if($queryOpts == "spatial")
3 |
4 | #set($loc = $request.params.get('pt'))
5 | #set($dist = $request.params.get('d', "10"))
6 |
20 | Distance (KM):
22 |
23 |
24 |
25 |
26 |
40 | #end
--------------------------------------------------------------------------------
/solr_conf/velocity/suggest.vm:
--------------------------------------------------------------------------------
1 | #foreach($t in $response.response.terms.name)
2 | $t.key
3 | #end
--------------------------------------------------------------------------------
/solr_conf/velocity/tabs.vm:
--------------------------------------------------------------------------------
1 | ##TODO: Make some nice tabs here
2 | #set($queryOpts = $params.get("queryOpts"))
3 |
--------------------------------------------------------------------------------
/solr_conf/xslt/index.html:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/test/controllers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/controllers/.keep
--------------------------------------------------------------------------------
/test/controllers/concerns/doi_trap_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class DoiTrapTest < ActionController::TestCase
4 |
5 | include QuickSearch::DoiTrap
6 |
7 | test "should be a doi" do
8 | doi = '10.1016/0046-8177(95)90302-X'
9 | is_a_doi = is_a_doi?(doi)
10 | assert is_a_doi
11 | end
12 |
13 | test "should not be a doi" do
14 | doi = '0046-8177(95)90302-X'
15 | is_a_doi = is_a_doi?(doi)
16 | assert_not is_a_doi
17 | end
18 |
19 | end
20 |
--------------------------------------------------------------------------------
/test/controllers/concerns/on_campus_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class OnCampusTest < ActionController::TestCase
4 |
5 | include QuickSearch::OnCampus
6 |
7 | test "should be on campus" do
8 | ip = '192.168.1.100'
9 | on_campus = on_campus?(ip)
10 | assert on_campus
11 | end
12 |
13 | test "should not be on campus" do
14 | ip = '152.2.1.1'
15 | on_campus = on_campus?(ip)
16 | assert_not on_campus
17 | end
18 |
19 | end
20 |
--------------------------------------------------------------------------------
/test/controllers/concerns/query_parser_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class QueryParserTest < ActionController::TestCase
4 |
5 | include QuickSearch::QueryParser
6 |
7 | test "should extract basic prefixed scoped query" do
8 | full_query = 'scope:scrc libraries'
9 |
10 | query = extracted_query(full_query)
11 | assert_equal('libraries', query)
12 |
13 | scope = extracted_scope(full_query)
14 | assert_equal('scrc', scope)
15 | end
16 |
17 | test "should extract basic suffixed scoped query" do
18 | full_query = 'libraries scope:scrc'
19 |
20 | query = extracted_query(full_query)
21 | assert_equal('libraries', query)
22 |
23 | scope = extracted_scope(full_query)
24 | assert_equal('scrc', scope)
25 | end
26 |
27 | test "should extract compound prefixed scoped query" do
28 | full_query = 'scope:(scrc OR jobs) libraries'
29 |
30 | query = extracted_query(full_query)
31 | assert_equal('libraries', query)
32 |
33 | scope = extracted_scope(full_query)
34 | assert_equal('scrc OR jobs', scope)
35 | end
36 |
37 | test "should extract compound suffixed scoped query" do
38 | full_query = 'libraries scope:(scrc OR jobs)'
39 |
40 | query = extracted_query(full_query)
41 | assert_equal('libraries', query)
42 |
43 | scope = extracted_scope(full_query)
44 | assert_equal('scrc OR jobs', scope)
45 | end
46 |
47 | end
48 |
--------------------------------------------------------------------------------
/test/controllers/quick_search/appstats_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class QuickSearch::AppstatsControllerTest < ActionController::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/controllers/quick_search/opensearch_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class QuickSearch::OpensearchControllerTest < ActionController::TestCase
4 | include QuickSearch::Engine.routes.url_helpers
5 |
6 | setup do
7 | @routes = QuickSearch::Engine.routes
8 | end
9 |
10 | test "should return xml" do
11 | @request.env['HTTP_ACCEPT'] = 'application/xml'
12 | get :opensearch
13 |
14 | assert_response :success
15 | assert_select 'OpenSearchDescription'
16 | end
17 |
18 | end
19 |
--------------------------------------------------------------------------------
/test/controllers/quick_search/pages_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class QuickSearch::PagesControllerTest < ActionController::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/controllers/quick_search/search_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class QuickSearch::SearchControllerTest < ActionController::TestCase
4 |
5 | # vcr_test "should return a summon searcher" do
6 | # get :index, q: 'printing'
7 | # assert assigns(:summon)
8 | # end
9 |
10 | test "should redirect to link resolver" do
11 | get :index, params: { q: 'doi:10.1002/0470841559.ch1' }
12 | assert_redirected_to 'http://doi.org/10.1002%2F0470841559.ch1'
13 | end
14 |
15 | end
16 |
--------------------------------------------------------------------------------
/test/dummy/README.rdoc:
--------------------------------------------------------------------------------
1 | == README
2 |
3 | This README would normally document whatever steps are necessary to get the
4 | application up and running.
5 |
6 | Things you may want to cover:
7 |
8 | * Ruby version
9 |
10 | * System dependencies
11 |
12 | * Configuration
13 |
14 | * Database creation
15 |
16 | * Database initialization
17 |
18 | * How to run the test suite
19 |
20 | * Services (job queues, cache servers, search engines, etc.)
21 |
22 | * Deployment instructions
23 |
24 | * ...
25 |
26 |
27 | Please feel free to use a different markup language if you do not plan to run
28 |
.
29 |
--------------------------------------------------------------------------------
/test/dummy/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/dummy/app/assets/images/.keep
--------------------------------------------------------------------------------
/test/dummy/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | // This is a manifest file that'll be compiled into application.js, which will include all the files
2 | // listed below.
3 | //
4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6 | //
7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 | // compiled file.
9 | //
10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11 | // about supported directives.
12 | //
13 | //= require_tree .
14 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any styles
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11 | * file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/test/dummy/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Prevent CSRF attacks by raising an exception.
3 | # For APIs, you may want to use :null_session instead.
4 | protect_from_forgery with: :exception
5 | end
6 |
--------------------------------------------------------------------------------
/test/dummy/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/dummy/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/test/dummy/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/test/dummy/app/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/dummy/app/mailers/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/dummy/app/models/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/dummy/app/models/concerns/.keep
--------------------------------------------------------------------------------
/test/dummy/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test/dummy/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/test/dummy/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path('../../config/application', __FILE__)
3 | require_relative '../config/boot'
4 | require 'rails/commands'
5 |
--------------------------------------------------------------------------------
/test/dummy/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/test/dummy/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run Rails.application
5 |
--------------------------------------------------------------------------------
/test/dummy/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | Bundler.require(*Rails.groups)
6 | require "quick_search"
7 |
8 | module Dummy
9 | class Application < Rails::Application
10 | # Settings in config/environments/* take precedence over those specified here.
11 | # Application configuration should go into files in config/initializers
12 | # -- all .rb files in that directory are automatically loaded.
13 |
14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16 | # config.time_zone = 'Central Time (US & Canada)'
17 |
18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20 | # config.i18n.default_locale = :de
21 | end
22 | end
23 |
24 |
--------------------------------------------------------------------------------
/test/dummy/config/boot.rb:
--------------------------------------------------------------------------------
1 | # Set up gems listed in the Gemfile.
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3 |
4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
6 |
--------------------------------------------------------------------------------
/test/dummy/config/database.yml:
--------------------------------------------------------------------------------
1 | # SQLite version 3.x
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem 'sqlite3'
6 | #
7 | default: &default
8 | adapter: sqlite3
9 | pool: 5
10 | timeout: 5000
11 |
12 | development:
13 | <<: *default
14 | database: db/development.sqlite3
15 |
16 | # Warning: The database defined as "test" will be erased and
17 | # re-generated from your development database when you run "rake".
18 | # Do not set this db to the same as development or production.
19 | test:
20 | <<: *default
21 | database: db/test.sqlite3
22 |
23 | production:
24 | <<: *default
25 | database: db/production.sqlite3
26 |
--------------------------------------------------------------------------------
/test/dummy/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Do not eager load code on boot.
10 | config.eager_load = false
11 |
12 | # Show full error reports and disable caching.
13 | config.consider_all_requests_local = true
14 | config.action_controller.perform_caching = false
15 |
16 | # Don't care if the mailer can't send.
17 | config.action_mailer.raise_delivery_errors = false
18 |
19 | # Print deprecation notices to the Rails logger.
20 | config.active_support.deprecation = :log
21 |
22 | # Raise an error on page load if there are pending migrations.
23 | config.active_record.migration_error = :page_load
24 |
25 | # Debug mode disables concatenation and preprocessing of assets.
26 | # This option may cause significant delays in view rendering with a large
27 | # number of complex assets.
28 | config.assets.debug = true
29 |
30 | # Adds additional error checking when serving assets at runtime.
31 | # Checks for improperly declared sprockets dependencies.
32 | # Raises helpful error messages.
33 | config.assets.raise_runtime_errors = true
34 |
35 | # Raises error for missing translations
36 | # config.action_view.raise_on_missing_translations = true
37 | end
38 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure static asset server for tests with Cache-Control for performance.
16 | config.serve_static_assets = true
17 | config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
18 |
19 | # Show full error reports and disable caching.
20 | config.consider_all_requests_local = true
21 | config.action_controller.perform_caching = false
22 |
23 | # Raise exceptions instead of rendering exception templates.
24 | config.action_dispatch.show_exceptions = false
25 |
26 | # Disable request forgery protection in test environment.
27 | config.action_controller.allow_forgery_protection = false
28 |
29 | # Tell Action Mailer not to deliver emails to the real world.
30 | # The :test delivery method accumulates sent emails in the
31 | # ActionMailer::Base.deliveries array.
32 | config.action_mailer.delivery_method = :test
33 |
34 | # Print deprecation notices to the stderr.
35 | config.active_support.deprecation = :stderr
36 |
37 | # Raises error for missing translations
38 | # config.action_view.raise_on_missing_translations = true
39 | end
40 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = '1.0'
5 |
6 | # Precompile additional assets.
7 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8 | # Rails.application.config.assets.precompile += %w( search.js )
9 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.action_dispatch.cookies_serializer = :json
--------------------------------------------------------------------------------
/test/dummy/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session'
4 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/test/dummy/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more, please read the Rails Internationalization guide
20 | # available at http://guides.rubyonrails.org/i18n.html.
21 |
22 | en:
23 | hello: "Hello world"
24 |
--------------------------------------------------------------------------------
/test/dummy/config/quick_search_config.yml:
--------------------------------------------------------------------------------
1 | defaults: &defaults
2 | theme: 'quick_search_generic_theme'
3 | searchers: [best_bets,arxiv,open_library,wikipedia,placeholder]
4 | found_types: [arxiv,open_library,wikipedia,placeholder,placeholder,placeholder,placeholder]
5 | per_page: 3
6 | max_per_page: 50
7 | http_timeout: 1.5
8 | xhr_http_timeout: 15
9 | # google_analytics_tracking_id: ""
10 | user: "stats"
11 | password: "stats"
12 |
13 | on_campus:
14 | - !ruby/regexp '/^192\.(1|168)\.\d*\.\d*$/'
15 |
16 |
17 | common_searches: ["web of science", "google scholar", "refworks", "harvard business review", "pubmed", "ieee"]
18 |
19 | common_website_searches: ["dissertations", "exhibits", "textbooks", "visit the libraries", "government information", "literature review", "printing"]
20 |
21 | loaded_searches:
22 | - name: "Google Scholar"
23 | landing_page: "http://scholar.google.com/"
24 | query: "https://scholar.google.com/scholar?hl=en&q="
25 | - name: "WorldCat"
26 | landing_page: "https://www.worldcat.org"
27 | query: "https://www.worldcat.org/search?qt=worldcat_org_all&q="
28 | - name: "Google"
29 | landing_page: "https://www.google.com/"
30 | query: "https://www.google.com/#q="
31 |
32 | loaded_website_searches:
33 | - name: "Books, Articles, Journals & More"
34 | landing_page: "http://search.lib.ncsu.edu"
35 | query: "http://search.lib.ncsu.edu/?q="
36 |
37 | doi_loaded_link: "http://doi.org/"
38 |
39 | best_bets:
40 | solr_url: ""
41 |
42 | development:
43 | <<: *defaults
44 | # realtime_url: http://path_to_websockets_server
45 |
46 | test:
47 | <<: *defaults
48 |
49 | staging:
50 | <<: *defaults
51 | # realtime_url: http://path_to_websockets_server
52 | # google_analytics_tracking_id: ""
53 |
54 |
55 | production:
56 | <<: *defaults
57 | # realtime_url: http://path_to_websockets_server
58 | # Add or override config options here
59 |
--------------------------------------------------------------------------------
/test/dummy/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 |
3 | mount QuickSearch::Engine => "/"
4 |
5 | root :to => 'quick_search/search#index'
6 | end
7 |
--------------------------------------------------------------------------------
/test/dummy/config/secrets.yml:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rake secret` to generate a secure secret key.
9 |
10 | # Make sure the secrets in this file are kept private
11 | # if you're sharing your code publicly.
12 |
13 | development:
14 | secret_key_base: a8bbd73446c5820d69983af81bf721d963095bfd336f72bf463c49867a8783de4fdd483f4cf4738b99096627da2654223066b7271a3f6fcf648e95c6c1e7d9e2
15 |
16 | test:
17 | secret_key_base: f9d6cd8b5f7d5f0ea57d8aba396eeadf42abb25683282649de20aead68ea44228dba194a27380128c8e2576328d3a577cd45bc522d6bda362b900f0d564d1f58
18 |
19 | # Do not keep production secrets in the repository,
20 | # instead read values from the environment.
21 | production:
22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
23 |
--------------------------------------------------------------------------------
/test/dummy/db/schema.rb:
--------------------------------------------------------------------------------
1 | # This file is auto-generated from the current state of the database. Instead
2 | # of editing this file, please use the migrations feature of Active Record to
3 | # incrementally modify your database, and then regenerate this schema definition.
4 | #
5 | # Note that this schema.rb definition is the authoritative source for your
6 | # database schema. If you need to create the application database on another
7 | # system, you should be using db:schema:load, not running all the migrations
8 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9 | # you'll amass, the slower it'll run and the greater likelihood for issues).
10 | #
11 | # It's strongly recommended that you check this file into your version control system.
12 |
13 | ActiveRecord::Schema.define(version: 20161212192454) do
14 |
15 | create_table "events", force: :cascade do |t|
16 | t.string "category"
17 | t.string "item"
18 | t.string "query"
19 | t.datetime "created_at"
20 | t.datetime "updated_at"
21 | t.string "action"
22 | t.integer "session_id"
23 | t.string "created_at_string"
24 | t.index ["created_at_string"], name: "index_events_on_created_at_string"
25 | t.index ["session_id"], name: "index_events_on_session_id"
26 | end
27 |
28 | create_table "searches", force: :cascade do |t|
29 | t.string "query"
30 | t.datetime "created_at"
31 | t.datetime "updated_at"
32 | t.string "page"
33 | t.integer "session_id"
34 | t.string "created_at_string"
35 | t.index ["created_at_string"], name: "index_searches_on_created_at_string"
36 | t.index ["session_id"], name: "index_searches_on_session_id"
37 | end
38 |
39 | create_table "sessions", force: :cascade do |t|
40 | t.string "session_uuid"
41 | t.datetime "expiry"
42 | t.boolean "on_campus"
43 | t.boolean "is_mobile"
44 | t.datetime "created_at"
45 | t.datetime "updated_at"
46 | t.string "created_at_string"
47 | t.index ["created_at_string"], name: "index_sessions_on_created_at_string"
48 | end
49 |
50 | end
51 |
--------------------------------------------------------------------------------
/test/dummy/db/test.sqlite3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/dummy/db/test.sqlite3
--------------------------------------------------------------------------------
/test/dummy/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/dummy/lib/assets/.keep
--------------------------------------------------------------------------------
/test/dummy/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/dummy/log/.keep
--------------------------------------------------------------------------------
/test/dummy/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/test/dummy/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/test/dummy/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/test/dummy/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/dummy/public/favicon.ico
--------------------------------------------------------------------------------
/test/fixtures/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/fixtures/.keep
--------------------------------------------------------------------------------
/test/fixtures/events.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | category: MyString
5 | action: MyString
6 | label: MyString
7 |
8 | two:
9 | category: MyString
10 | action: MyString
11 | label: MyString
12 |
--------------------------------------------------------------------------------
/test/fixtures/searches.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | query: MyString
5 |
6 | two:
7 | query: MyString
8 |
--------------------------------------------------------------------------------
/test/helpers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/helpers/.keep
--------------------------------------------------------------------------------
/test/helpers/appstats_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class AppstatsHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/opensearch_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class OpensearchHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/pages_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class PagesHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/search_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class SearchHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/integration/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/integration/.keep
--------------------------------------------------------------------------------
/test/integration/landing_page_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class LandingPageTest < ActionDispatch::IntegrationTest
4 | test "should have a search box" do
5 | visit root_path
6 | assert page.has_selector?('#main-search-form')
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/test/integration/searching_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class SearchingTest < ActionDispatch::IntegrationTest
4 |
5 | vcr_test "included searchers should appear on results page", "searches", cassette: 'printing' do
6 | visit root_path(:q => 'printing')
7 | assert page.assert_text('Wikipedia')
8 | assert page.has_content?('OpenLibrary')
9 | assert page.has_content?('arXiv')
10 | assert page.has_content?('Placeholder')
11 | end
12 |
13 | vcr_test "should have wikipedia results", "searches", cassette: 'hunt_library' do
14 | visit root_path(:q => 'James B. Hunt Jr. Library')
15 | assert page.has_content?('James B. Hunt Jr. Library')
16 | end
17 |
18 | vcr_test "should present a spelling suggestion", "searches", cassette: 'speling' do
19 | visit root_path(:q => 'speling')
20 | assert page.has_content?('Did you mean')
21 | end
22 |
23 | vcr_test "should have Open Library results", "searches", cassette: 'harry potter' do
24 | visit root_path(:q => 'harry potter')
25 | assert page.has_content?('Harry Potter')
26 | end
27 |
28 | end
29 |
--------------------------------------------------------------------------------
/test/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/mailers/.keep
--------------------------------------------------------------------------------
/test/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/test/models/.keep
--------------------------------------------------------------------------------
/test/models/event_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class EventTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/search_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class SearchTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/searcher/best_bets_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class BestBetsSearcherTest < ActiveSupport::TestCase
4 |
5 | setup do
6 | @best_bets = QuickSearch::BestBetsSearcher.new(HTTPClient.new, 'acm digital library', 1)
7 | @best_bets_eric = QuickSearch::BestBetsSearcher.new(HTTPClient.new, 'eric', 1)
8 | end
9 |
10 | test "should have http client, query, and per_page" do
11 | assert @best_bets.http.is_a? HTTPClient
12 | assert @best_bets.q == 'acm digital library'
13 | assert_equal 1, @best_bets.per_page
14 | end
15 |
16 | test "should fall back to local yml file if no solr url defined" do
17 | QuickSearch::Engine::APP_CONFIG['best_bets']['solr_url'] = ''
18 | @best_bets_eric.search
19 | parsed_results = @best_bets_eric.results
20 | assert parsed_results.first.title.include?('ERIC (Educational Resource Information Center)')
21 | end
22 |
23 | vcr_test "should make request to solr if solr_url defined", 'searches', cassette: 'best_bets_acm' do
24 | QuickSearch::Engine::APP_CONFIG['best_bets']['solr_url'] = 'http://localhost:8983/solr/bestbets/select?'
25 | @best_bets.search
26 | parsed_results = @best_bets.results
27 | assert parsed_results.first.title.include?('ACM')
28 | end
29 |
30 | end
31 |
--------------------------------------------------------------------------------
/test/support/vcr_test.rb:
--------------------------------------------------------------------------------
1 | module VcrTest
2 | def vcr_test(name, group = nil, vcr_options ={}, &block)
3 | # cribbed from Rails and modified for VCR
4 | # https://github.com/rails/rails/blob/b451de0d6de4df6bc66b274cec73b919f823d5ae/activesupport/lib/active_support/testing/declarative.rb#L25
5 |
6 | if group.nil?
7 | group = self.name.underscore
8 | end
9 |
10 | test_name_safe = name.gsub(/\s+/,'_')
11 |
12 | test_method_name = "test_#{test_name_safe}".to_sym
13 |
14 | raise "#{test_method_name} is already defined in #{self}" if methods.include?(test_method_name)
15 |
16 | cassette_name = vcr_options.delete(:cassette)
17 | unless cassette_name
18 | # calculate default cassette name from test name
19 | cassette_name = test_name_safe
20 | end
21 |
22 | # put in group subdir if group
23 | cassette_name = "#{group}/#{cassette_name}" if group
24 |
25 | # default tag with groupname, can be over-ridden.
26 | vcr_options = {:tag => group}.merge(vcr_options) if group
27 |
28 | if block_given?
29 | define_method(test_method_name) do
30 | VCR.use_cassette(cassette_name , vcr_options) do
31 | instance_eval &block
32 | end
33 | end
34 | else
35 | define_method(test_method_name) do
36 | flunk "No implementation provided for #{name}"
37 | end
38 | end
39 | end
40 | end
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | ENV["RAILS_ENV"] ||= "test"
2 | require File.expand_path("../dummy/config/environment.rb", __FILE__)
3 | ActiveRecord::Migrator.migrations_paths = [File.expand_path("../dummy/db/migrate", __FILE__)]
4 | ActiveRecord::Migrator.migrations_paths << File.expand_path('../db/migrate', __FILE__)
5 | ActiveRecord::Migration.maintain_test_schema!
6 | require 'rails/test_help'
7 | require 'capybara/rails'
8 | require 'vcr'
9 | require 'headless'
10 |
11 | # Filter out Minitest backtrace while allowing backtrace from other libraries
12 | # to be shown.
13 | Minitest.backtrace_filter = Minitest::BacktraceFilter.new
14 |
15 | # Load support files
16 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
17 |
18 | headless = Headless.new
19 | headless.start
20 |
21 |
22 | # Load fixtures from the engine
23 | if ActiveSupport::TestCase.method_defined?(:fixture_path=)
24 | ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
25 | end
26 |
27 | class ActiveSupport::TestCase
28 | ActiveRecord::Migration.check_pending!
29 | extend VcrTest
30 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
31 | #
32 | # Note: You'll currently still have to declare fixtures explicitly in integration tests
33 | # -- they do not yet inherit this setting
34 | fixtures :all
35 |
36 | # Add more helper methods to be used by all tests here...
37 | end
38 |
39 | class ActionDispatch::IntegrationTest
40 | # Make the Capybara DSL available in all integration tests
41 | include Capybara::DSL
42 |
43 | Capybara.run_server = true
44 | Capybara.server_port = 7000
45 | Capybara.app_host = "http://localhost:#{Capybara.server_port}"
46 | Capybara.javascript_driver = :webkit
47 | Capybara.default_max_wait_time = 8
48 |
49 | end
50 |
51 | VCR.configure do |c|
52 | # c.ignore_localhost = true
53 | c.hook_into :webmock
54 | c.cassette_library_dir = 'test/vcr_cassettes'
55 | end
56 |
--------------------------------------------------------------------------------
/test/vcr_cassettes/searches/best_bets_acm.yml:
--------------------------------------------------------------------------------
1 | ---
2 | http_interactions:
3 | - request:
4 | method: get
5 | uri: http://localhost:8983/solr/bestbets/select?defType=dismax&mm=4&q=acm%20digital%20library&wt=json
6 | body:
7 | encoding: UTF-8
8 | string: ''
9 | headers:
10 | User-Agent:
11 | - HTTPClient/1.0 (2.8.0, ruby 2.1.7 (2015-08-18))
12 | Accept:
13 | - "*/*"
14 | Date:
15 | - Tue, 03 May 2016 17:44:31 GMT
16 | response:
17 | status:
18 | code: 200
19 | message: OK
20 | headers:
21 | Content-Type:
22 | - text/plain; charset=UTF-8
23 | Transfer-Encoding:
24 | - chunked
25 | body:
26 | encoding: UTF-8
27 | string: |
28 | {"responseHeader":{"status":0,"QTime":2,"params":{"mm":"4","q":"acm digital library","defType":"dismax","wt":"json"}},"response":{"numFound":1,"start":0,"docs":[{"id":"acm","title":"ACM Digital Library","url":"http://www.acm.org/dl/","description":"Provides access to ACM journals, magazines, and conference proceedings","keywords":["acm","acm digital library","acm portal","acm database","acm digital"],"_version_":1527825036370509824}]}}
29 | http_version:
30 | recorded_at: Tue, 03 May 2016 17:44:31 GMT
31 | recorded_with: VCR 2.9.3
32 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/vendor/assets/javascripts/.keep
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCSU-Libraries/quick_search/59a76f68a3f73239fc03e17002f1a07a954b2276/vendor/assets/stylesheets/.keep
--------------------------------------------------------------------------------