Class: Google::Apis::CloudsearchV1::Segment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Segment

Returns a new instance of Segment.



18412
18413
18414
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18412

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

Instance Attribute Details

#formattingGoogle::Apis::CloudsearchV1::Formatting

Formatting information for a segment. Corresponds to the JSON property formatting



18353
18354
18355
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18353

def formatting
  @formatting
end

#hashtag_dataGoogle::Apis::CloudsearchV1::HashtagData

Hashtag metadata, for HASHTAG segments. For a hashtag, the "text" field should contain the display text, and the search_text field should represent the topic being referenced, without the hash symbol; for example, we might have: text = "

Google" hashtag_data.search_text = "Google" Another example: text = "#pikachu"

hashtag_data.search_text = "Pokemon" Both strings should be considered part of the searchable text. In go/sbe, both are indexed and searchable. Corresponds to the JSON property hashtagData



18363
18364
18365
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18363

def hashtag_data
  @hashtag_data
end

Link metadata, for LINK segments. Anchor text should be stored in the "text" field of the Segment, which can also serve as a fallback. Corresponds to the JSON property linkData



18369
18370
18371
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18369

def link_data
  @link_data
end

SearchLink metadata, for SEARCH_LINK segments. For a search link, the "text" field should contain the display text. This is currently not indexed. Corresponds to the JSON property searchLinkData



18375
18376
18377
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18375

def search_link_data
  @search_link_data
end

#textString

Text content of the Segment. As a general rule, this field should contain the actual text that should be rendered in the UI. Thus, for a hashtag, it should be "#Foo", and for a link, it should be the display text. Clients that do not understand a particular segment type may use this text, along with the Formatting info below, as a fallback for display. The field is not required -- if all relevant information is carried in other metadata fields and there is no need for a fallback, or it is not practical for a fallback to be provided for any other reason, the field may be left blank. A standard example would be a user reference being transmitted between server layers, where a gaia-ID representation may be sufficient and there is no need for a textual fallback. In such a case, it would be valid and useful - though not required - for servers to compute and populate a fallback on the serving path. Corresponds to the JSON property text

Returns:

  • (String)


18391
18392
18393
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18391

def text
  @text
end

#typeString

Type of Segment. Corresponds to the JSON property type

Returns:

  • (String)


18396
18397
18398
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18396

def type
  @type
end

#user_mention_dataGoogle::Apis::CloudsearchV1::UserMentionData

Person metadata, for USER_MENTION segments. Should always contain at least one of user_gaia_id, user_id, email or user. The exact set of populated fields may differ depending on the context and the level in the serving stack; for example, emails will be elided on the viewing path. But as a general rule, a proto having any one of the four is valid, subject to the standard constraints of the applied annotations -- that is, communication between servers and clients will ignore jspb.ignore fields, and communication between servers and other servers (or between servers and storage) will ignore client_only fields. For more on the annotations, see the comments in social/common/ segment_annotations.proto Corresponds to the JSON property userMentionData



18410
18411
18412
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18410

def user_mention_data
  @user_mention_data
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



18417
18418
18419
18420
18421
18422
18423
18424
18425
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18417

def update!(**args)
  @formatting = args[:formatting] if args.key?(:formatting)
  @hashtag_data = args[:hashtag_data] if args.key?(:hashtag_data)
  @link_data = args[:link_data] if args.key?(:link_data)
  @search_link_data = args[:search_link_data] if args.key?(:search_link_data)
  @text = args[:text] if args.key?(:text)
  @type = args[:type] if args.key?(:type)
  @user_mention_data = args[:user_mention_data] if args.key?(:user_mention_data)
end