Class: Google::Apis::CloudsearchV1::FreshnessOptions

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/cloudsearch_v1/classes.rb,
lib/google/apis/cloudsearch_v1/representations.rb,
lib/google/apis/cloudsearch_v1/representations.rb

Overview

Indicates which freshness property to use when adjusting search ranking for an item. Fresher, more recent dates indicate higher quality. Use the freshness option property that best works with your data. For fileshare documents, last modified time is most relevant. For calendar event data, the time when the event occurs is a more relevant freshness indicator. In this way, calendar events that occur closer to the time of the search query are considered higher quality and ranked accordingly.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ FreshnessOptions

Returns a new instance of FreshnessOptions.



9347
9348
9349
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 9347

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#freshness_durationString

The duration after which an object should be considered stale. The default value is 180 days (in seconds). Corresponds to the JSON property freshnessDuration

Returns:

  • (String)


9335
9336
9337
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 9335

def freshness_duration
  @freshness_duration
end

#freshness_propertyString

This property indicates the freshness level of the object in the index. If set, this property must be a top-level property within the property definitions and it must be a timestamp type or date type. Otherwise, the Indexing API uses updateTime as the freshness indicator. The maximum length is 256 characters. When a property is used to calculate freshness, the value defaults to 2 years from the current time. Corresponds to the JSON property freshnessProperty

Returns:

  • (String)


9345
9346
9347
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 9345

def freshness_property
  @freshness_property
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



9352
9353
9354
9355
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 9352

def update!(**args)
  @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)
  @freshness_property = args[:freshness_property] if args.key?(:freshness_property)
end