<commit_before># frozen_string_literal: true

module SearchPhotos
  extend ActiveSupport::Concern

  included do
    searchkick merge_mappings: true, mappings: {
      properties: {
        title: { type: :text },
        created_at: { type: :integer }
      }
    }

    def search_data
      {
        id: id,
        title: title,
        thumbnail_url: thumbnail_url,
        fullsize_url: fullsize_url,
        # crops
        crops: crops.pluck(:id),
        # likes
        liked_by_members_names: liked_by_members_names,
        # owner
        owner_id: owner_id,
        owner_login_name: owner.login_name,
        # counts
        likes_count: likes_count,

        created_at: created_at.to_i
      }
    end
  end
end<commit_msg>style fix ups<commit_after># frozen_string_literal: true

module SearchPhotos
  extend ActiveSupport::Concern

  included do
    searchkick merge_mappings: true, mappings: {
      properties: {
        title:      { type: :text },
        created_at: { type: :integer }
      }
    }

    def search_data
      {
        id:                     id,
        title:                  title,
        thumbnail_url:          thumbnail_url,
        fullsize_url:           fullsize_url,
        # crops
        crops:                  crops.pluck(:id),
        # likes
        liked_by_members_names: liked_by_members_names,
        # owner
        owner_id:               owner_id,
        owner_login_name:       owner.login_name,
        # counts
        likes_count:            likes_count,

        created_at:             created_at.to_i
      }
    end
  end
end
{'fraction_non_alphanumeric': 0.07102803738317758, 'fraction_numerical': 0.0, 'mean_word_length': 1.6327868852459015, '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': '6595693', 'n_tokens_mistral': 487, 'n_tokens_neox': 474, 'n_words': 99}