<commit_before>module Searchkick
  module Search

    def search(term, options = {})
      term = term.to_s
      fields = options[:fields] ? options[:fields].map{|f| "#{f}.analyzed" } : ["_all"]
      operator = options[:partial] ? "or" : "and"
      load = options[:load].nil? ? true : options[:load]
      load = (options[:include] ? {include: options[:include]} : true) if load
      page = options.has_key?(:page) ? [options[:page].to_i, 1].max : nil
      tire_options = {
        load: load,
        page: page,
        per_page: options[:limit] || options[:per_page] || 100000 # return all
      }<commit_msg>Backwards-compatible for zero downtime gem updates<commit_after>module Searchkick
  module Search

    def search(term, options = {})
      term = term.to_s
      fields = options[:fields] || ["_all"]
      operator = options[:partial] ? "or" : "and"
      load = options[:load].nil? ? true : options[:load]
      load = (options[:include] ? {include: options[:include]} : true) if load
      page = options.has_key?(:page) ? [options[:page].to_i, 1].max : nil
      tire_options = {
        load: load,
        page: page,
        per_page: options[:limit] || options[:per_page] || 100000 # return all
      }
{'fraction_non_alphanumeric': 0.16055419722901385, 'fraction_numerical': 0.011409942950285249, 'mean_word_length': 2.9485530546623795, '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': '5968790', 'n_tokens_mistral': 394, 'n_tokens_neox': 377, 'n_words': 93}