Skip to content

Commit

Permalink
Search improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed May 9, 2024
1 parent c0c56ad commit c1b4996
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/controllers/concerns/has_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ def build_basic_search
@search = model.search(
params[:search] || '*',
includes: model.search_includes,
fields: ['full_identifier^20', 'identifier^20', 'title^10', 'description'], # Boost
match: :word_start,
fields: [
{ 'full_identifier^20': :word_start },
{ 'identifier^20': :word_start },
'title^10',
'description',
'*'
],

aggs: model.search_agg_fields,

Expand Down
1 change: 1 addition & 0 deletions app/models/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def search_data
field_of_research: field_of_research_name,
languages: languages.map(&:name),
countries: countries.map(&:name),
language_codes: languages.map(&:code),

# Full text plus advanced search
identifier:,
Expand Down

0 comments on commit c1b4996

Please sign in to comment.