Google Cloud Discovery Engine V1 Client - Class SearchResponse (1.3.2)

Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class SearchResponse.

Response message for SearchService.Search method.

Generated from protobuf message google.cloud.discoveryengine.v1.SearchResponse

Namespace

Google \ Cloud \ DiscoveryEngine \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ results array<SearchResponse\SearchResult>

A list of matched documents. The order represents the ranking.

↳ facets array<SearchResponse\Facet>

Results of facets requested by user.

↳ total_size int

The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.

↳ attribution_token string

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance. This also helps to identify a request during the customer support scenarios.

↳ redirect_uri string

The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.

↳ next_page_token string

A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

↳ corrected_query string

Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.

↳ summary SearchResponse\Summary

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

↳ query_expansion_info SearchResponse\QueryExpansionInfo

Query expansion information for the returned results.

↳ session_info SearchResponse\SessionInfo

Session information. Only set if SearchRequest.session is provided. See its description for more details.

getResults

A list of matched documents. The order represents the ranking.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setResults

A list of matched documents. The order represents the ranking.

Parameter
Name Description
var array<SearchResponse\SearchResult>
Returns
Type Description
$this

getFacets

Results of facets requested by user.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setFacets

Results of facets requested by user.

Parameter
Name Description
var array<SearchResponse\Facet>
Returns
Type Description
$this

getTotalSize

The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.

Returns
Type Description
int

setTotalSize

The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.

Parameter
Name Description
var int
Returns
Type Description
$this

getAttributionToken

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance. This also helps to identify a request during the customer support scenarios.

Returns
Type Description
string

setAttributionToken

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance. This also helps to identify a request during the customer support scenarios.

Parameter
Name Description
var string
Returns
Type Description
$this

getRedirectUri

The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.

Returns
Type Description
string

setRedirectUri

The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.

Parameter
Name Description
var string
Returns
Type Description
$this

getNextPageToken

A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

Returns
Type Description
string

setNextPageToken

A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

Parameter
Name Description
var string
Returns
Type Description
$this

getCorrectedQuery

Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query.

Otherwise the original query is used for search.

Returns
Type Description
string

setCorrectedQuery

Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query.

Otherwise the original query is used for search.

Parameter
Name Description
var string
Returns
Type Description
$this

getSummary

A summary as part of the search results.

This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

Returns
Type Description
SearchResponse\Summary|null

hasSummary

clearSummary

setSummary

A summary as part of the search results.

This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

Parameter
Name Description
var SearchResponse\Summary
Returns
Type Description
$this

getQueryExpansionInfo

Query expansion information for the returned results.

Returns
Type Description
SearchResponse\QueryExpansionInfo|null

hasQueryExpansionInfo

clearQueryExpansionInfo

setQueryExpansionInfo

Query expansion information for the returned results.

Parameter
Name Description
var SearchResponse\QueryExpansionInfo
Returns
Type Description
$this

getSessionInfo

Session information.

Only set if SearchRequest.session is provided. See its description for more details.

Returns
Type Description
SearchResponse\SessionInfo|null

hasSessionInfo

clearSessionInfo

setSessionInfo

Session information.

Only set if SearchRequest.session is provided. See its description for more details.

Parameter
Name Description
var SearchResponse\SessionInfo
Returns
Type Description
$this