Skip to content

Commit

Permalink
update update jump to returned result labels to show only one
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Dec 7, 2023
1 parent a61b645 commit a4ae82e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def json_search
# record_type = format_record_type(result[:recordType], result[:obsolete])
record_type = ""

target_value = result.prefLabel
target_value = result.prefLabel.select{|x| x.include?( params[:q].delete('*'))}.first || result.prefLabel.first

case params[:target]
when "name"
target_value = result.prefLabel
Expand All @@ -46,7 +47,7 @@ def json_search
json << "|#{record_type}"
json << "|#{result.explore.ontology.acronym}"
json << "|#{result.id}" # Duplicated because we used to have shortId and fullId
json << "|#{result.prefLabel}"
json << "|#{target_value}"
# This is nasty, but hard to workaround unless we rewrite everything (form_autocomplete, jump_to, crossdomain_autocomplete)
# to use JSON from the bottom up. To avoid this, we pass a tab separated column list
# Columns: synonym
Expand Down

0 comments on commit a4ae82e

Please sign in to comment.