<commit_before>class WelcomController < ApplicationController
  PER = 10

  def index
    @events = Event.page(params[:page]).per(PER).
      where('start_time > ?', Time.zone.now).order(:start_time)
  end
end
<commit_msg>Fix search<commit_after>class WelcomController < ApplicationController
  PER = 10

  def index
    @q = Event.page(params[:page]).per(PER).order(:start_time).search(search_params)

    @events = @q.result(distinct: true)
  end

  private

  def search_params
    params.require(:q).permit!
  rescue
    { start_time_gteq: Time.zone.now }
  end
end

{'fraction_non_alphanumeric': 0.12456140350877193, 'fraction_numerical': 0.007017543859649123, 'mean_word_length': 4.008771929824562, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '7571549', 'n_tokens_mistral': 197, 'n_tokens_neox': 188, 'n_words': 36}