in common-lib/src/main/scala/com/gu/mediaservice/lib/elasticsearch/Mappings.scala [82:198]
def dimensionsMapping(name: String) = nonDynamicObjectField(name).copy(properties = Seq(
intField("width"),
intField("height")
))
def assetMapping(name: String) = nonDynamicObjectField(name).copy(properties = Seq(
nonIndexedString("file"),
nonIndexedString("secureUrl"),
intField("size"),
keywordField("mimeType"),
dimensionsMapping("dimensions")
))
def metadataMapping(name: String): ObjectField = nonDynamicObjectField(name).copy(properties = Seq(
dateField("dateTaken"),
sStemmerAnalysed("description"),
standardAnalysed("byline").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
standardAnalysed("bylineTitle"),
sStemmerAnalysed("title"),
keywordField("credit").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
keywordField("creditUri"),
standardAnalysed("copyright"),
standardAnalysed("suppliersReference").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
keywordField("source").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
nonAnalysedList("keywords").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
nonAnalysedList("subjects"),
standardAnalysed("specialInstructions").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
standardAnalysed("subLocation").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
standardAnalysed("city").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
standardAnalysed("state").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
standardAnalysed("country").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
standardAnalysed("peopleInImage").copy(copyTo = Seq("metadata.englishAnalysedCatchAll")),
sStemmerAnalysed("englishAnalysedCatchAll"),
dynamicObj("domainMetadata"),
keywordField("imageType")
))
def originalMetadataMapping(name: String): ObjectField = nonDynamicObjectField(name).copy(properties = Seq(
dateField("dateTaken"),
sStemmerAnalysed("description"),
standardAnalysed("byline"),
standardAnalysed("bylineTitle"),
sStemmerAnalysed("title"),
keywordField("credit"),
keywordField("creditUri"),
standardAnalysed("copyright"),
standardAnalysed("suppliersReference"),
keywordField("source"),
nonAnalysedList("keywords"),
nonAnalysedList("subjects"),
standardAnalysed("specialInstructions"),
standardAnalysed("subLocation"),
standardAnalysed("city"),
standardAnalysed("state"),
standardAnalysed("country"),
standardAnalysed("peopleInImage"),
dynamicObj("domainMetadata"),
keywordField("imageType")
))
def usageRightsMapping(name: String): ObjectField = nonDynamicObjectField(name).copy(properties = Seq(
keywordField("category"),
standardAnalysed("restrictions"),
keywordField("supplier"),
keywordField("suppliersCollection"),
standardAnalysed("photographer"),
keywordField("publication"),
keywordField("creator"),
keywordField("licence"),
keywordField("source"),
keywordField("contentLink"),
standardAnalysed("suppliers"),
keywordField("independentType"),
keywordField("productionCompany"),
))
def syndicationRightsPropertiesMapping(name: String): ObjectField = nonDynamicObjectField(name).copy(properties = Seq(
keywordField("propertyCode"),
dateField("expiresOn"),
keywordField("value")
))
def syndicationRightsListMapping(name: String) = nonDynamicObjectField(name).copy(properties = Seq(
keywordField("rightCode"),
booleanField("acquired"),
syndicationRightsPropertiesMapping("properties")
))
def suppliersMapping(name: String): ObjectField = nonDynamicObjectField(name).copy(properties = Seq(
keywordField("supplierId"),
keywordField("supplierName"),
booleanField("prAgreement")
))
def syndicationRightsMapping(name: String) = nonDynamicObjectField(name).copy(properties = Seq(
dateField("published"),
suppliersMapping("suppliers"),
syndicationRightsListMapping("rights"),
booleanField("isInferred")
))
def exportsMapping(name: String) = nonDynamicObjectField(name).copy(properties = Seq(
keywordField("id"),
keywordField("type"),
keywordField("author"),
dateField("date"),
dynamicObj("specification"),
assetMapping("master"),
assetMapping("assets")
))
def actionDataMapping(name: String) = {
nonDynamicObjectField(name).copy(properties = Seq(
keywordField("author"),
dateField("date")
))
}