Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class MediaConfig.
Specifies the configurations needed for Media Discovery. Currently we
support:
demote_content_watched: Threshold for watched content demotion.
Customers can specify if using watched content demotion or use viewed
detail page. Using the content watched demotion, customers need to specify
the watched minutes or percentage exceeds the threshold, the content will
be demoted in the recommendation result.
promote_fresh_content: cutoff days for fresh content promotion.
Customers can specify if using content freshness promotion. If the content
was published within the cutoff days, the content will be promoted in the
recommendation result.
Can only be set if
SolutionType is
SOLUTION_TYPE_RECOMMENDATION.
Generated from protobuf message google.cloud.discoveryengine.v1.ServingConfig.MediaConfig
Namespace
Google \ Cloud \ DiscoveryEngine \ V1 \ ServingConfig
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ content_watched_percentage_threshold
float
Specifies the content watched percentage threshold for demotion. Threshold value must be between [0, 1.0] inclusive.
↳ content_watched_seconds_threshold
float
Specifies the content watched minutes threshold for demotion.
↳ demotion_event_type
string
Specifies the event type used for demoting recommendation result. Currently supported values: * * view-item: Item viewed. * * media-play: Start/resume watching a video, playing a song, etc. * * media-complete: Finished or stopped midway through a video, song, etc. If unset, watch history demotion will not be applied. Content freshness demotion will still be applied.
↳ demote_content_watched_past_days
int
Optional. Specifies the number of days to look back for demoting watched content. If set to zero or unset, defaults to the maximum of 365 days.
↳ content_freshness_cutoff_days
int
Specifies the content freshness used for recommendation result. Contents will be demoted if contents were published for more than content freshness cutoff days.
getContentWatchedPercentageThreshold
Specifies the content watched percentage threshold for demotion.
Threshold value must be between [0, 1.0] inclusive.
Returns
Type
Description
float
hasContentWatchedPercentageThreshold
setContentWatchedPercentageThreshold
Specifies the content watched percentage threshold for demotion.
Threshold value must be between [0, 1.0] inclusive.
Parameter
Name
Description
var
float
Returns
Type
Description
$this
getContentWatchedSecondsThreshold
Specifies the content watched minutes threshold for demotion.
Returns
Type
Description
float
hasContentWatchedSecondsThreshold
setContentWatchedSecondsThreshold
Specifies the content watched minutes threshold for demotion.
Parameter
Name
Description
var
float
Returns
Type
Description
$this
getDemotionEventType
Specifies the event type used for demoting recommendation result.
Currently supported values:
view-item: Item viewed.
media-play: Start/resume watching a video, playing a song, etc.
media-complete: Finished or stopped midway through a video, song,
etc.
If unset, watch history demotion will not be applied. Content freshness
demotion will still be applied.
Returns
Type
Description
string
setDemotionEventType
Specifies the event type used for demoting recommendation result.
Currently supported values:
view-item: Item viewed.
media-play: Start/resume watching a video, playing a song, etc.
media-complete: Finished or stopped midway through a video, song,
etc.
If unset, watch history demotion will not be applied. Content freshness
demotion will still be applied.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDemoteContentWatchedPastDays
Optional. Specifies the number of days to look back for demoting watched
content. If set to zero or unset, defaults to the maximum of 365 days.
Returns
Type
Description
int
setDemoteContentWatchedPastDays
Optional. Specifies the number of days to look back for demoting watched
content. If set to zero or unset, defaults to the maximum of 365 days.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getContentFreshnessCutoffDays
Specifies the content freshness used for recommendation result.
Contents will be demoted if contents were published for more than content
freshness cutoff days.
Returns
Type
Description
int
setContentFreshnessCutoffDays
Specifies the content freshness used for recommendation result.
Contents will be demoted if contents were published for more than content
freshness cutoff days.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Discovery Engine V1 Client - Class MediaConfig (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/php/docs/reference/cloud-discoveryengine/latest/V1.ServingConfig.MediaConfig)\n- [1.6.1](/php/docs/reference/cloud-discoveryengine/1.6.1/V1.ServingConfig.MediaConfig)\n- [1.5.1](/php/docs/reference/cloud-discoveryengine/1.5.1/V1.ServingConfig.MediaConfig)\n- [1.4.0](/php/docs/reference/cloud-discoveryengine/1.4.0/V1.ServingConfig.MediaConfig)\n- [1.3.3](/php/docs/reference/cloud-discoveryengine/1.3.3/V1.ServingConfig.MediaConfig)\n- [1.2.0](/php/docs/reference/cloud-discoveryengine/1.2.0/V1.ServingConfig.MediaConfig)\n- [1.1.0](/php/docs/reference/cloud-discoveryengine/1.1.0/V1.ServingConfig.MediaConfig)\n- [1.0.0](/php/docs/reference/cloud-discoveryengine/1.0.0/V1.ServingConfig.MediaConfig)\n- [0.11.3](/php/docs/reference/cloud-discoveryengine/0.11.3/V1.ServingConfig.MediaConfig)\n- [0.8.0](/php/docs/reference/cloud-discoveryengine/0.8.0/V1.ServingConfig.MediaConfig)\n- [0.7.1](/php/docs/reference/cloud-discoveryengine/0.7.1/V1.ServingConfig.MediaConfig)\n- [0.6.0](/php/docs/reference/cloud-discoveryengine/0.6.0/V1.ServingConfig.MediaConfig)\n- [0.5.0](/php/docs/reference/cloud-discoveryengine/0.5.0/V1.ServingConfig.MediaConfig)\n- [0.4.0](/php/docs/reference/cloud-discoveryengine/0.4.0/V1.ServingConfig.MediaConfig)\n- [0.3.0](/php/docs/reference/cloud-discoveryengine/0.3.0/V1.ServingConfig.MediaConfig)\n- [0.2.0](/php/docs/reference/cloud-discoveryengine/0.2.0/V1.ServingConfig.MediaConfig)\n- [0.1.1](/php/docs/reference/cloud-discoveryengine/0.1.1/V1.ServingConfig.MediaConfig) \nReference documentation and code samples for the Google Cloud Discovery Engine V1 Client class MediaConfig.\n\nSpecifies the configurations needed for Media Discovery. Currently we\nsupport:\n\n- `demote_content_watched`: Threshold for watched content demotion.\n\nCustomers can specify if using watched content demotion or use viewed\ndetail page. Using the content watched demotion, customers need to specify\nthe watched minutes or percentage exceeds the threshold, the content will\nbe demoted in the recommendation result.\n\n- `promote_fresh_content`: cutoff days for fresh content promotion. Customers can specify if using content freshness promotion. If the content was published within the cutoff days, the content will be promoted in the recommendation result. Can only be set if [SolutionType](/php/docs/reference/cloud-discoveryengine/latest/V1.SolutionType) is [SOLUTION_TYPE_RECOMMENDATION](/php/docs/reference/cloud-discoveryengine/latest/V1.SolutionType#_Google_Cloud_DiscoveryEngine_V1_SolutionType__SOLUTION_TYPE_RECOMMENDATION).\n\nGenerated from protobuf message `google.cloud.discoveryengine.v1.ServingConfig.MediaConfig`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ DiscoveryEngine \\\\ V1 \\\\ ServingConfig\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getContentWatchedPercentageThreshold\n\nSpecifies the content watched percentage threshold for demotion.\n\nThreshold value must be between \\[0, 1.0\\] inclusive.\n\n### hasContentWatchedPercentageThreshold\n\n### setContentWatchedPercentageThreshold\n\nSpecifies the content watched percentage threshold for demotion.\n\nThreshold value must be between \\[0, 1.0\\] inclusive.\n\n### getContentWatchedSecondsThreshold\n\nSpecifies the content watched minutes threshold for demotion.\n\n### hasContentWatchedSecondsThreshold\n\n### setContentWatchedSecondsThreshold\n\nSpecifies the content watched minutes threshold for demotion.\n\n### getDemotionEventType\n\nSpecifies the event type used for demoting recommendation result.\n\nCurrently supported values:\n\n- `view-item`: Item viewed.\n- `media-play`: Start/resume watching a video, playing a song, etc.\n- `media-complete`: Finished or stopped midway through a video, song, etc. If unset, watch history demotion will not be applied. Content freshness demotion will still be applied.\n\n### setDemotionEventType\n\nSpecifies the event type used for demoting recommendation result.\n\nCurrently supported values:\n\n- `view-item`: Item viewed.\n- `media-play`: Start/resume watching a video, playing a song, etc.\n- `media-complete`: Finished or stopped midway through a video, song, etc. If unset, watch history demotion will not be applied. Content freshness demotion will still be applied.\n\n### getDemoteContentWatchedPastDays\n\nOptional. Specifies the number of days to look back for demoting watched\ncontent. If set to zero or unset, defaults to the maximum of 365 days.\n\n### setDemoteContentWatchedPastDays\n\nOptional. Specifies the number of days to look back for demoting watched\ncontent. If set to zero or unset, defaults to the maximum of 365 days.\n\n### getContentFreshnessCutoffDays\n\nSpecifies the content freshness used for recommendation result.\n\nContents will be demoted if contents were published for more than content\nfreshness cutoff days.\n\n### setContentFreshnessCutoffDays\n\nSpecifies the content freshness used for recommendation result.\n\nContents will be demoted if contents were published for more than content\nfreshness cutoff days.\n\n### getDemoteContentWatched"]]