Class: Google::Apis::CloudsearchV1::Segment
- Inherits:
-
Object
- Object
- Google::Apis::CloudsearchV1::Segment
- 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
-
#formatting ⇒ Google::Apis::CloudsearchV1::Formatting
Formatting information for a segment.
-
#hashtag_data ⇒ Google::Apis::CloudsearchV1::HashtagData
Hashtag metadata, for HASHTAG segments.
-
#link_data ⇒ Google::Apis::CloudsearchV1::LinkData
Link metadata, for LINK segments.
-
#search_link_data ⇒ Google::Apis::CloudsearchV1::SearchLinkData
SearchLink metadata, for SEARCH_LINK segments.
-
#text ⇒ String
Text content of the Segment.
-
#type ⇒ String
Type of Segment.
-
#user_mention_data ⇒ Google::Apis::CloudsearchV1::UserMentionData
Person metadata, for USER_MENTION segments.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Segment
constructor
A new instance of Segment.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Segment
Returns a new instance of Segment.
18574 18575 18576 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18574 def initialize(**args) update!(**args) end |
Instance Attribute Details
#formatting ⇒ Google::Apis::CloudsearchV1::Formatting
Formatting information for a segment.
Corresponds to the JSON property formatting
18515 18516 18517 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18515 def formatting @formatting end |
#hashtag_data ⇒ Google::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
18525 18526 18527 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18525 def hashtag_data @hashtag_data end |
#link_data ⇒ Google::Apis::CloudsearchV1::LinkData
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
18531 18532 18533 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18531 def link_data @link_data end |
#search_link_data ⇒ Google::Apis::CloudsearchV1::SearchLinkData
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
18537 18538 18539 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18537 def search_link_data @search_link_data end |
#text ⇒ String
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
18553 18554 18555 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18553 def text @text end |
#type ⇒ String
Type of Segment.
Corresponds to the JSON property type
18558 18559 18560 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18558 def type @type end |
#user_mention_data ⇒ Google::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
18572 18573 18574 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18572 def user_mention_data @user_mention_data end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
18579 18580 18581 18582 18583 18584 18585 18586 18587 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 18579 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 |