<commit_before>require 'sunspot'

namespace :services do
  namespace :solr do
    task :run do
      path = File.expand_path(File.dirname(__FILE__) + '/../../config') + '/sunspot.yml'
      log_path = File.expand_path(File.dirname(__FILE__) + '/../../log')

      rails_environment = ENV['RAILS_ENV'] || 'development'

      solr_config = YAML.load_file(path)[rails_environment]

      server = Sunspot::Solr::Server.new
      server.port = solr_config['solr']['port']
      server.log_level = solr_config['solr']['log_level']
      server.solr_data_dir = (Rails.root + "solr/data/#{rails_environment}/").to_s
      server.log_file = log_path + "/solr-#{rails_environment}.log"

      server.run
    end
  end<commit_msg>[#33024295] only bind solr to localhost<commit_after>require 'sunspot'

namespace :services do
  namespace :solr do
    task :run do
      path = File.expand_path(File.dirname(__FILE__) + '/../../config') + '/sunspot.yml'
      log_path = File.expand_path(File.dirname(__FILE__) + '/../../log')

      rails_environment = ENV['RAILS_ENV'] || 'development'

      solr_config = YAML.load_file(path)[rails_environment]

      server = Sunspot::Solr::Server.new
      server.bind_address = 'localhost'
      server.port = solr_config['solr']['port']
      server.log_level = solr_config['solr']['log_level']
      server.solr_data_dir = (Rails.root + "solr/data/#{rails_environment}/").to_s
      server.log_file = log_path + "/solr-#{rails_environment}.log"

      server.run
    end
  end
{'fraction_non_alphanumeric': 0.15716180371352786, 'fraction_numerical': 0.005305039787798408, 'mean_word_length': 3.386627906976744, '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': '4696746', 'n_tokens_mistral': 527, 'n_tokens_neox': 497, 'n_words': 82}