<commit_before># frozen_string_literal: true
# rubocop:disable Metrics/ModuleLength
module GenericSortFilter
  def self.transform(base_query, params)
    adjusted_params = snake_case_contents(params)
    query = ensure_query(base_query)
    query = transform_by_searching(query, adjusted_params[:query])
    query = transform_by_joining(query, adjusted_params)
    query = transform_by_ordering(query, adjusted_params)
    transform_by_filtering(query, adjusted_params).uniq<commit_msg>changed order in generic_search_filter: pq_search query-filtering after order (fixes broken ordering when pg search is used)<commit_after># frozen_string_literal: true
# rubocop:disable Metrics/ModuleLength
module GenericSortFilter
  def self.transform(base_query, params)
    adjusted_params = snake_case_contents(params)
    query = ensure_query(base_query)
    query = transform_by_joining(query, adjusted_params)
    query = transform_by_ordering(query, adjusted_params)
    query = transform_by_searching(query, adjusted_params[:query])
    transform_by_filtering(query, adjusted_params).uniq
{'fraction_non_alphanumeric': 0.07202216066481995, 'fraction_numerical': 0.0, 'mean_word_length': 7.029629629629629, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1758363', 'n_tokens_mistral': 314, 'n_tokens_neox': 310, 'n_words': 64}