MetadataMapping
Maps a document field to one of Google Cloud Search's standard item metadata fields.
Notes
Google Cloud Search items carry a fixed set of metadata fields. These mappings
say which of your document fields fills each one — a dc:title becoming
title, a last_modified becoming updateTime.
Anything not mapped here can still be sent as structured data; see StructuredDataMapping.
Examples
Fills the item title from dc:title, falling back to a constant, and sets the
update time from the crawler's last-modified field.
- YAML
- JSON
- XML
metadataMappings:
- fromField: dc:title
toField: title
defaultValue: Untitled
- fromField: document.lastModified
toField: updateTime
keepFromField: true
{
"metadataMappings": [
{
"fromField": "dc:title",
"toField": "title",
"defaultValue": "Untitled"
},
{
"fromField": "document.lastModified",
"toField": "updateTime",
"keepFromField": true
}
]
}
<metadataMappings>
<fromField>dc:title</fromField>
<toField>title</toField>
<defaultValue>Untitled</defaultValue>
<fromField>document.lastModified</fromField>
<toField>updateTime</toField>
<keepFromField>true</keepFromField>
</metadataMappings>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
defaultValue: string
fromField: string
keepFromField: false
toField: title
{
"defaultValue": "string",
"fromField": "string",
"keepFromField": false,
"toField": "title"
}
<metadataMapping>
<defaultValue>string</defaultValue>
<fromField>string</fromField>
<keepFromField>false</keepFromField>
<toField>title</toField>
</metadataMapping>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
defaultValue | string | No | - |
fromField | string | No | - |
keepFromField | boolean | No | false |
toField | enum | No | - |
Property Details
defaultValue
Value used when fromField is missing or blank on a document. Set it alone,
without fromField, to give every item the same constant value.
fromField
Document field supplying the value.
keepFromField
Whether fromField is also kept in the item's structured data rather than only
being mapped to toField. Default is false, which moves the value rather
than copying it.
toField
The Google Cloud Search metadata field to populate: title, objectType,
mimeType, updateTime, createTime, containerName, contentLanguage,
sourceRepositoryUrl, hash, keywords or searchQualityMetadata. Required.
Allowed Values
titleobjectTypemimeTypeupdateTimecreateTimecontainerNamecontentLanguagesourceRepositoryUrlhashkeywordssearchQualityMetadata