<commit_before>module Hyrax
  # Finds objects under lease
  class LeaseSearchBuilder < Blacklight::SearchBuilder
    self.default_processor_chain = [:with_pagination, :with_sorting, :only_active_leases]

    # TODO: add more complex pagination
    def with_pagination(solr_params)
      solr_params[:rows] = 1000
    end

    def with_sorting(solr_params)
      solr_params[:sort] = 'lease_expiration_date_dtsi desc'
    end

    def only_active_leases(solr_params)
      solr_params[:fq] ||= []
      solr_params[:fq] = 'lease_expiration_date_dtsi:*'
    end
  end
end
<commit_msg>Work with solr.DatePointField<commit_after>module Hyrax
  # Finds objects under lease
  class LeaseSearchBuilder < Blacklight::SearchBuilder
    self.default_processor_chain = [:with_pagination, :with_sorting, :only_active_leases]

    # TODO: add more complex pagination
    def with_pagination(solr_params)
      solr_params[:rows] = 1000
    end

    def with_sorting(solr_params)
      solr_params[:sort] = 'lease_expiration_date_dtsi desc'
    end

    def only_active_leases(solr_params)
      solr_params[:fq] ||= []
      solr_params[:fq] = 'lease_expiration_date_dtsi:[* TO *]'
    end
  end
end

{'fraction_non_alphanumeric': 0.08761583824768324, 'fraction_numerical': 0.006739679865206402, 'mean_word_length': 4.165217391304348, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3742321', 'n_tokens_mistral': 429, 'n_tokens_neox': 410, 'n_words': 77}