<commit_before>class Article < Entry
  
  include Tire::Model::Search
  include Tire::Model::Callbacks
  
  field :content,         type: String
  field :preambel,        type: String
  
  validates :content,     presence: true
  validates :preambel,    presence: true
  
  # Tire, Mongoid requirements
  index_name 'articles'
  
  tire.settings AutocompleteAnalyzer do
    mapping {
      indexes :id,            type: 'string',       index: :not_analyzed
      indexes :type,          type: 'string',       index: :not_analyzed
  
      indexes :title,          type: 'multi_field',  fields: {
        title: {
          type: 'string',
          boost: 100,
          analyzer: 'autocomplete'
        },
        "title.exact" => { 
          type: 'string', 
          index: :not_analyzed
        }
      }
      indexes :preambel,          type: 'multi_field',  fields: {
        preambel: {
          type: 'string',
          boost: 30,
          analyzer: 'autocomplete'
        },<commit_msg>Fixed the stupid article bug.<commit_after>class Article < Entry
  
  include Tire::Model::Search
  include Tire::Model::Callbacks
  
  field :content,         type: String
  field :preambel,        type: String
  
  validates :content,     presence: true
  validates :preambel,    presence: true
  
  before_save do
    self._type = "Article"
  end
  
  # Tire, Mongoid requirements
  index_name 'articles'
  
  tire.settings AutocompleteAnalyzer do
    mapping {
      indexes :id,            type: 'string',       index: :not_analyzed
      indexes :type,          type: 'string',       index: :not_analyzed
  
      indexes :title,          type: 'multi_field',  fields: {
        title: {
          type: 'string',
          boost: 100,
          analyzer: 'autocomplete'
        },
        "title.exact" => { 
          type: 'string', 
          index: :not_analyzed
        }
      }
      indexes :preambel,          type: 'multi_field',  fields: {
        preambel: {
          type: 'string',
          boost: 30,
          analyzer: 'autocomplete'
        },
{'fraction_non_alphanumeric': 0.10091743119266056, 'fraction_numerical': 0.004828585224529213, 'mean_word_length': 1.7774798927613942, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4783992', 'n_tokens_mistral': 640, 'n_tokens_neox': 620, 'n_words': 155}