Skip to content

Commit

Permalink
potential fix for partial identifier search and ampersand regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse authored and Jesse committed Jan 24, 2023
1 parent b4acd70 commit c83617a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions public/app/controllers/concerns/searchable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def set_up_advanced_search(default_types = [], default_facets=[], default_search
advanced_query_builder = AdvancedQueryBuilder.new
@search[:q].each_with_index { |query, i|
query.gsub!(/\[\]/x) { |c| "\\" + c }
query.gsub!(/\&amp\;/,"&")
query = '*' if query.blank?
have_query = true
op = @search[:op][i]
Expand Down
2 changes: 1 addition & 1 deletion public/app/views/repositories/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
["#{t('search_results.filter.creators')}",'creators_text'],
["#{t('search_results.filter.subjects')}",'subjects_text'],
["#{t('search_results.filter.notes')}", 'notes'],
["#{t('search_results.filter.identifier')}", 'identifier'] ] } %>
["#{t('search_results.filter.identifier')}", 'four_part_id'] ] } %>
</div>
4 changes: 2 additions & 2 deletions public/app/views/search/search_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
["#{t('search_results.filter.creators')}",'creators_text'],
["#{t('search_results.filter.subjects')}",'subjects_text'],
["#{t('search_results.filter.notes')}", 'notes'],
["#{t('search_results.filter.identifier')}", 'identifier'] ],
["#{t('search_results.filter.identifier')}", 'four_part_id'] ],
:header_size => '2',
:show_header => true } %>
<% else %>
Expand All @@ -44,7 +44,7 @@
["#{t('search_results.filter.creators')}",'creators_text'],
["#{t('search_results.filter.subjects')}",'subjects_text'],
["#{t('search_results.filter.notes')}", 'notes'],
["#{t('search_results.filter.identifier')}", 'identifier'] ],
["#{t('search_results.filter.identifier')}", 'four_part_id'] ],
:show_header => false } %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/app/views/welcome/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
["#{t('search_results.filter.creators')}",'creators_text'],
["#{t('search_results.filter.subjects')}",'subjects_text'],
["#{t('search_results.filter.notes')}", 'notes'],
["#{t('search_results.filter.identifier')}", 'identifier']
["#{t('search_results.filter.identifier')}", 'four_part_id']
]
} %>

2 changes: 2 additions & 0 deletions public/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ en:
\ <span class='searchterm'>%{kw}</span>"
subjects_text_contain: "the <strong>subject</strong> contains\
\ <span class='searchterm'>%{kw}</span>"
four_part_id_contain: "the <strong>identifier</strong> contains\
\ <span class='searchterm'>%{kw}</span>"
identifier_contain: "the <strong>identifier</strong> contains\
\ <span class='searchterm'>%{kw}</span>"
in_repository: " in <strong>%{name}</strong>"
Expand Down

0 comments on commit c83617a

Please sign in to comment.