<commit_before>class Rummager < Sinatra::Application
  get '/content' do
    raw_result = find_result_by_link(params["link"])
    { raw_source: raw_result['_source'] }.to_json
  end

  delete '/content' do
    raw_result = find_result_by_link(params["link"])
    delete_result_from_index(raw_result)
    json_result 204, "Deleted the link from search index"
  end<commit_msg>Also send the index name in the result<commit_after>class Rummager < Sinatra::Application
  get '/content' do
    raw_result = find_result_by_link(params["link"])
    {
      index: Elasticsearch::Index.strip_alias_from_index_name(raw_result['_index']),
      raw_source: raw_result['_source']
    }.to_json
  end

  delete '/content' do
    raw_result = find_result_by_link(params["link"])
    delete_result_from_index(raw_result)
    json_result 204, "Deleted the link from search index"
  end
{'fraction_non_alphanumeric': 0.10229885057471265, 'fraction_numerical': 0.006896551724137931, 'mean_word_length': 4.768211920529802, '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': '473651', 'n_tokens_mistral': 290, 'n_tokens_neox': 282, 'n_words': 62}