<commit_before>package com.ubirch.avatar.util.server

import com.ubirch.avatar.config.Config
import com.ubirch.util.elasticsearch.util.ElasticsearchMappingsBase

/**
  * author: cvandrei
  * since: 2017-01-10
  */
trait ElasticsearchMappings extends ElasticsearchMappingsBase {

  val indexesAndMappings: Map[String, Map[String, String]] = Map(

    // ubirch-device-raw-data
    Config.esDeviceDataRawIndex -> Map(
      Config.esDeviceDataRawType ->
        s"""{
           |  "${Config.esDeviceDataRawType}" : {
           |    "properties" : {
           |      "a" : {
           |        "type" : "keyword"
           |      },
           |      "id" : {
           |        "type" : "keyword"
           |      },
           |      "deviceId" : {
           |        "type" : "keyword"
           |      },
           |      "s" : {
           |        "type" : "keyword"
           |      },
           |      "ts" : {
           |        "type" : "date",
           |        "format" : "strict_date_time"
           |      }
           |    }
           |  }
           |}""".stripMargin
    ),

    // ubirch-device-history
    Config.esDeviceDataHistoryIndex -> Map(
      Config.esDeviceDataHistoryType ->
        s"""{
           |  "${Config.esDeviceDataHistoryType}" : {
           |    "properties" : {
           |      "deviceId" : {
           |        "type" : "keyword"
           |      },
           |      "messageId" : {
           |        "type" : "keyword"
           |      },
           |      "deviceDataRawId" : {
           |        "type" : "keyword"
           |      },
           |      "id" : {
           |        "type" : "keyword"
           |      },
           |      "a" : {
           |        "type" : "keyword"
           |      },
           |      "deviceName" : {
           |        "type" : "keyword"
           |      },
           |      "timestamp" : {
           |        "type" : "date",
           |        "format" : "strict_date_time"
           |      }
           |    }
           |  }
           |}""".stripMargin
    ),

    // ubirch-device-raw-data-anchored
    Config.esDeviceDataRawAnchoredIndex -> Map(
      Config.esDeviceDataRawAnchoredType ->
        s"""{
           |  "${Config.esDeviceDataRawAnchoredType}" : {<commit_msg>added missing mapping<commit_after>package com.ubirch.avatar.util.server

import com.ubirch.avatar.config.Config
import com.ubirch.util.elasticsearch.util.ElasticsearchMappingsBase

/**
  * author: cvandrei
  * since: 2017-01-10
  */
trait ElasticsearchMappings extends ElasticsearchMappingsBase {

  val indexesAndMappings: Map[String, Map[String, String]] = Map(

    // ubirch-device-raw-data
    Config.esDeviceDataRawIndex -> Map(
      Config.esDeviceDataRawType ->
        s"""{
           |  "${Config.esDeviceDataRawType}" : {
           |    "properties" : {
           |      "a" : {
           |        "type" : "keyword"
           |      },
           |      "id" : {
           |        "type" : "keyword"
           |      },
           |      "deviceId" : {
           |        "type" : "keyword"
           |      },
           |      "s" : {
           |        "type" : "keyword"
           |      },
           |      "ts" : {
           |        "type" : "date",
           |        "format" : "strict_date_time"
           |      }
           |    }
           |  }
           |}""".stripMargin
    ),

    // ubirch-device-history
    Config.esDeviceDataHistoryIndex -> Map(
      Config.esDeviceDataHistoryType ->
        s"""{
           |  "${Config.esDeviceDataHistoryType}" : {
           |    "properties" : {
           |      "deviceId" : {
           |        "type" : "keyword"
           |      },
           |      "messageId" : {
           |        "type" : "keyword"
           |      },
           |      "deviceDataRawId" : {
           |        "type" : "keyword"
           |      },
           |      "id" : {
           |        "type" : "keyword"
           |      },
           |      "a" : {
           |        "type" : "keyword"
           |      },
           |      "deviceName" : {
           |        "type" : "keyword"
           |      },
           |      "timestamp" : {
           |        "type" : "date",
           |        "format" : "strict_date_time"
           |      },
           |      "deviceMessage.location" : {
           |        "type" : "geo_point"
           |      }
           |    }
           |  }
           |}""".stripMargin
    ),

    // ubirch-device-raw-data-anchored
    Config.esDeviceDataRawAnchoredIndex -> Map(
      Config.esDeviceDataRawAnchoredType ->
        s"""{
           |  "${Config.esDeviceDataRawAnchoredType}" : {
{'fraction_non_alphanumeric': 0.1413435049798686, 'fraction_numerical': 0.0033905488450943, 'mean_word_length': 1.0486111111111112, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3875562', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1412, 'n_words': 169}