Skip to main content

MetadataMapping

Maps a document field to one of Google Cloud Search's standard item metadata fields.

committer/googlecloudsearchJavadoc: MetadataMapping

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.

metadataMappings:
- fromField: dc:title
toField: title
defaultValue: Untitled
- fromField: document.lastModified
toField: updateTime
keepFromField: true

Usageโ€‹

Full configuration skeleton, with every option and its default
defaultValue: string
fromField: string
keepFromField: false
toField: title

Propertiesโ€‹

PropertyTypeRequiredDefault
defaultValuestringNo-
fromFieldstringNo-
keepFromFieldbooleanNofalse
toFieldenumNo-

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โ€‹

  • title
  • objectType
  • mimeType
  • updateTime
  • createTime
  • containerName
  • contentLanguage
  • sourceRepositoryUrl
  • hash
  • keywords
  • searchQualityMetadata