<commit_before>class MedicalConditionsGrid
  include Datagrid

  scope do
    MedicalCondition
  end

  filter(:id, :string, :multiple => ',')
  filter(:name, :string) { |value| where('name like ? ', "%#{value}%") }

  column(:id, :mandatory => true) do |model|
    format(model.id) { |value| link_to value, model }
  end
  column(:name, :mandatory => true) do |model|
    format(model.name) { |value| link_to value, model }
  end
  column(:description, :mandatory => true)
end<commit_msg>Change medical conditions grid to use new search method<commit_after>class MedicalConditionsGrid
  include Datagrid

  scope do
    MedicalCondition
  end

  filter(:id, :string, :multiple => ',')
  filter(:name, :string) { |value| where.has { name =~ "%#{value}%" } }

  column(:id, :mandatory => true) do |model|
    format(model.id) { |value| link_to value, model }
  end
  column(:name, :mandatory => true) do |model|
    format(model.name) { |value| link_to value, model }
  end
  column(:description, :mandatory => true)
end
{'fraction_non_alphanumeric': 0.1521099116781158, 'fraction_numerical': 0.0, 'mean_word_length': 4.230769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '407345', 'n_tokens_mistral': 337, 'n_tokens_neox': 330, 'n_words': 93}