<commit_before>package com.softwaremill.codebrag.dao

import net.liftweb.mongodb.record.{BsonMetaRecord, BsonRecord, MongoMetaRecord, MongoRecord}
import net.liftweb.mongodb.record.field._
import net.liftweb.record.field.{OptionalIntField, OptionalStringField, EnumNameField}
import net.liftweb.common.Box
import com.foursquare.rogue.LiftRogue._
import net.liftweb.json.JsonDSL._
import org.bson.types.ObjectId


class FollowupRecord extends MongoRecord[FollowupRecord] with ObjectIdPk[FollowupRecord] {

  def meta = FollowupRecord

  object receivingUserId extends ObjectIdField(this)

  object reactions extends MongoListField[FollowupRecord, ObjectId](this)

  object threadId extends BsonRecordField(this, ThreadIdRecord)

  object lastReaction extends BsonRecordField(this, LastReactionRecord)

}

object FollowupRecord extends FollowupRecord with MongoMetaRecord[FollowupRecord] {

  override def collectionName = "follow_ups_new"

  def ensureIndexes() {
    val commitIdField = threadId.subfield(_.commitId).name
    val fileNameField = threadId.subfield(_.fileName).name
    val lineNumberField = threadId.subfield(_.lineNumber).name
    this.ensureIndex(keys = (commitIdField -> 1) ~ (fileNameField -> 1) ~ (lineNumberField -> 1), unique = true)
  }

}

class LastReactionRecord extends BsonRecord[LastReactionRecord] {
  def meta = LastReactionRecord

  object reactionId extends ObjectIdField(this)
<commit_msg>Fix fields in followups collection index<commit_after>package com.softwaremill.codebrag.dao

import net.liftweb.mongodb.record.{BsonMetaRecord, BsonRecord, MongoMetaRecord, MongoRecord}
import net.liftweb.mongodb.record.field._
import net.liftweb.record.field.{OptionalIntField, OptionalStringField, EnumNameField}
import net.liftweb.common.Box
import com.foursquare.rogue.LiftRogue._
import net.liftweb.json.JsonDSL._
import org.bson.types.ObjectId


class FollowupRecord extends MongoRecord[FollowupRecord] with ObjectIdPk[FollowupRecord] {

  def meta = FollowupRecord

  object receivingUserId extends ObjectIdField(this)

  object reactions extends MongoListField[FollowupRecord, ObjectId](this)

  object threadId extends BsonRecordField(this, ThreadIdRecord)

  object lastReaction extends BsonRecordField(this, LastReactionRecord)

}

object FollowupRecord extends FollowupRecord with MongoMetaRecord[FollowupRecord] {

  override def collectionName = "follow_ups_new"

  def ensureIndexes() {
    val receivingUserIdField = receivingUserId.name
    val commitIdField = threadId.subfield(_.commitId).name
    val fileNameField = threadId.subfield(_.fileName).name
    val lineNumberField = threadId.subfield(_.lineNumber).name
    this.ensureIndex(keys = (receivingUserIdField -> 1) ~ (commitIdField -> 1) ~ (fileNameField -> 1) ~ (lineNumberField -> 1), unique = true)
  }

}

class LastReactionRecord extends BsonRecord[LastReactionRecord] {
  def meta = LastReactionRecord

  object reactionId extends ObjectIdField(this)

{'fraction_non_alphanumeric': 0.08150152181264796, 'fraction_numerical': 0.0023672641190395673, 'mean_word_length': 5.911214953271028, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '2407689', 'n_tokens_mistral': 907, 'n_tokens_neox': 867, 'n_words': 190}