Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix to make advanced search "facet query" fields work, e.g., Date … #394

Merged
merged 1 commit into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
2.2.2
31 changes: 0 additions & 31 deletions app/controllers/advanced_controller.rb

This file was deleted.

13 changes: 0 additions & 13 deletions app/controllers/advanced_trln_controller.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/controllers/search_history_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

class SearchHistoryController < ApplicationController
include Blacklight::SearchHistory

helper BlacklightAdvancedSearch::RenderConstraintsOverride
end
23 changes: 0 additions & 23 deletions app/helpers/render_constraints_helper.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/models/default_local_search_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ class DefaultLocalSearchBuilder < SearchBuilder
author_boost
subjects_boost
add_document_ids_query
facetize_advanced_search_fields
add_solr_debug]
end
1 change: 0 additions & 1 deletion app/models/default_trln_search_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ class DefaultTrlnSearchBuilder < SearchBuilder
author_boost
subjects_boost
add_document_ids_query
facetize_advanced_search_fields
add_solr_debug]
end
23 changes: 0 additions & 23 deletions app/views/blacklight_advanced_search/_facet_limit.html.erb

This file was deleted.

45 changes: 0 additions & 45 deletions lib/blacklight_advanced_search/render_constraints_override.rb

This file was deleted.

2 changes: 0 additions & 2 deletions lib/trln_argon/argon_search_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
require 'trln_argon/argon_search_builder/subjects_boost'
require 'trln_argon/argon_search_builder/wildcard_char_strip'
require 'trln_argon/argon_search_builder/share_bookmarks'
require 'trln_argon/argon_search_builder/advanced_search_cleanup'

module TrlnArgon
# Shared SearchBuilder behaviors concerning record rollup,
Expand All @@ -26,6 +25,5 @@ module ArgonSearchBuilder
include SubjectsBoost
include WildcardCharStrip
include ShareBookmarks
include AdvancedSearchCleanup
end
end
65 changes: 0 additions & 65 deletions lib/trln_argon/argon_search_builder/advanced_search_cleanup.rb

This file was deleted.

12 changes: 6 additions & 6 deletions lib/trln_argon/controller_override.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ module ControllerOverride
'facet.field' => [TrlnArgon::Fields::AVAILABLE_FACET.to_s,
TrlnArgon::Fields::ACCESS_TYPE_FACET.to_s,
TrlnArgon::Fields::RESOURCE_TYPE_FACET.to_s,
TrlnArgon::Fields::LANGUAGE_FACET.to_s],
TrlnArgon::Fields::LANGUAGE_FACET.to_s,
TrlnArgon::Fields::DATE_CATALOGED_FACET.to_s],
'f.resource_type_f.facet.limit' => -1, # return all resource type values
'f.language_f.facet.limit' => -1, # return all language facet values
'f.date_cataloged_dt.facet.limit' => -1, # return all date facet values
'facet.limit' => -1, # return all facet values
'facet.sort' => 'index', # sort by byte order of values
'facet.query' => ''
'facet.sort' => 'index' # sort by byte order of values
}

config.index.title_field = TrlnArgon::Fields::TITLE_MAIN.to_s
Expand Down Expand Up @@ -253,9 +254,8 @@ module ControllerOverride
'last_three_months' => { label: I18n.t('trln_argon.new_title_ranges.now_minus_three_months'),
fq: "#{TrlnArgon::Fields::DATE_CATALOGED_FACET}:[NOW-3MONTH/DAY TO NOW]" } },
label: TrlnArgon::Fields::DATE_CATALOGED_FACET.label,
limit: true
# Hide Advanced search New Titles facet until it's fixed
# advanced_search_component: TrlnArgon::AdvancedSearchFacetFieldComponent
limit: true,
advanced_search_component: TrlnArgon::AdvancedSearchFacetFieldComponent

# hierarchical facet configuration
config.facet_display ||= {}
Expand Down
4 changes: 0 additions & 4 deletions lib/trln_argon/view_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ module ViewHelpers
autoload :BlacklightHelperBehavior, 'trln_argon/view_helpers/blacklight_helper_behavior'
autoload :CatalogHelperBehavior, 'trln_argon/view_helpers/catalog_helper_behavior'
autoload :HierarchyHelper, 'trln_argon/view_helpers/hierarchy_helper'
# autoload :RenderConstraintsHelperBehavior,
# 'trln_argon/view_helpers/render_constraints_helper_behavior'
autoload :SearchHistoryConstraintsHelperBehavior,
'trln_argon/view_helpers/search_history_constraints_helper_behavior'
autoload :TrlnArgonHelper, 'trln_argon/view_helpers/trln_argon_helper'
end
end
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module TrlnArgon
module ViewHelpers
module RenderConstraintsHelperBehavior
# include BlacklightAdvancedSearch::RenderConstraintsOverride

# handles a special case only in TRLN
def render_constraints_query(my_params = params)
if my_params[:doc_ids].nil?
Expand Down
9 changes: 0 additions & 9 deletions spec/controllers/advanced_controller_spec.rb

This file was deleted.

9 changes: 0 additions & 9 deletions spec/controllers/advanced_trln_controller_spec.rb

This file was deleted.

This file was deleted.

7 changes: 4 additions & 3 deletions spec/lib/trln_argon/controller_override_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ class ControllerOverrideTestClass < CatalogController
'facet.field' => [TrlnArgon::Fields::AVAILABLE_FACET.to_s,
TrlnArgon::Fields::ACCESS_TYPE_FACET.to_s,
TrlnArgon::Fields::RESOURCE_TYPE_FACET.to_s,
TrlnArgon::Fields::LANGUAGE_FACET.to_s],
TrlnArgon::Fields::LANGUAGE_FACET.to_s,
TrlnArgon::Fields::DATE_CATALOGED_FACET.to_s],
'f.date_cataloged_dt.facet.limit' => -1,
'f.resource_type_f.facet.limit' => -1,
'f.language_f.facet.limit' => -1,
'facet.limit' => -1,
'facet.sort' => 'index',
'facet.query' => ''
'facet.sort' => 'index'
)
end
end
Expand Down