<commit_before>namespace :rummager do
  desc "Reindex search engine"
  task :index => :environment do
    documents = SmartAnswer::FlowRegistry.new.flows.map { |flow|
      next unless flow.status == :published
      presenter = TextPresenter.new(flow)
      {
        "title"             => presenter.title,
        "description"       => presenter.description,
        "format"            => "smart_answer",
        "section"           => presenter.section_slug,
        "subsection"        => presenter.subsection_slug,
        "link"              => "/#{flow.name}",
        "indexable_content" => presenter.text,
      }
    }

    # Calculate your holiday entitlement
    documents << {
      "title"             => "Calculate your holiday entitlement",
      "description"       => "Calculate your annual leave",
      "format"            => "calculator",
      "section"           => "work",
      "link"              => "/calculate-your-holiday-entitlement",
      "indexable_content" => "Use this calculator to work out how much statutory holiday leave you're entitled to."
    }

    Rummageable.index documents.compact
  end
end
<commit_msg>adding holiday pay calculator to time off subsection of work<commit_after>namespace :rummager do
  desc "Reindex search engine"
  task :index => :environment do
    documents = SmartAnswer::FlowRegistry.new.flows.map { |flow|
      next unless flow.status == :published
      presenter = TextPresenter.new(flow)
      {
        "title"             => presenter.title,
        "description"       => presenter.description,
        "format"            => "smart_answer",
        "section"           => presenter.section_slug,
        "subsection"        => presenter.subsection_slug,
        "link"              => "/#{flow.name}",
        "indexable_content" => presenter.text,
      }
    }

    # Calculate your holiday entitlement
    documents << {
      "title"             => "Calculate your holiday entitlement",
      "description"       => "Calculate your annual leave",
      "format"            => "calculator",
      "section"           => "work",
      "subsection"        => "time-off",
      "link"              => "/calculate-your-holiday-entitlement",
      "indexable_content" => "Use this calculator to work out how much statutory holiday leave you're entitled to."
    }

    Rummageable.index documents.compact
  end
end

{'fraction_non_alphanumeric': 0.11445279866332497, 'fraction_numerical': 0.0, 'mean_word_length': 2.066581306017926, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 32, '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': '4703658', 'n_tokens_mistral': 656, 'n_tokens_neox': 632, 'n_words': 159}