Skip to content

Commit

Permalink
Use word_middle for course search
Browse files Browse the repository at this point in the history
  • Loading branch information
thekeenant authored Oct 24, 2024
1 parent 7fe1342 commit 3aae6c8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/models/course.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ def self.search_with_page(query, page, per_page, where={})
per_page: per_pages.min,
where: where,
misspellings: {below: 5},
match: :text_middle,
fields: [:names, :uuid])
match: :word_middle,
fields: [:names, :uuid],
operator: "or")
end

def self.search_without_page(query)
Course.search(prepare_query(query), misspellings: {below: 5})
Course.search(prepare_query(query),
misspellings: {below: 5},
match: :word_middle,
fields: [:names, :uuid],
operator: "or")
end

def search_data
Expand Down

0 comments on commit 3aae6c8

Please sign in to comment.