Google Cloud Discovery Engine V1beta Client - Class SearchResponse (0.5.0)

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

Response message for SearchService.Search method.

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

Namespace

Google \ Cloud \ DiscoveryEngine \ V1beta

Methods

__construct

Constructor.

Parameters
NameDescription
dataarray

Optional. Data for populating the Message object.

↳ resultsarray<Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\SearchResult>

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

↳ facetsarray<Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\Facet>

Results of facets requested by user.

↳ guided_search_resultGoogle\Cloud\DiscoveryEngine\V1beta\SearchResponse\GuidedSearchResult

Guided search result.

↳ total_sizeint

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_tokenstring

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.

↳ redirect_uristring

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_tokenstring

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_querystring

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.

↳ summaryGoogle\Cloud\DiscoveryEngine\V1beta\SearchResponse\Summary

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

↳ applied_controlsarray

Controls applied as part of the Control service.

getResults

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

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setResults

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

Parameter
NameDescription
vararray<Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\SearchResult>
Returns
TypeDescription
$this

getFacets

Results of facets requested by user.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setFacets

Results of facets requested by user.

Parameter
NameDescription
vararray<Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\Facet>
Returns
TypeDescription
$this

getGuidedSearchResult

Guided search result.

Returns
TypeDescription
Google\Cloud\DiscoveryEngine\V1beta\SearchResponse\GuidedSearchResult|null

hasGuidedSearchResult

clearGuidedSearchResult

setGuidedSearchResult

Guided search result.

Parameter
NameDescription
varGoogle\Cloud\DiscoveryEngine\V1beta\SearchResponse\GuidedSearchResult
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
varint
Returns
TypeDescription
$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.

Returns
TypeDescription
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.

Parameter
NameDescription
varstring
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
varstring
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
varstring
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
varstring
Returns
TypeDescription
$this

getSummary

A summary as part of the search results.

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

Returns
TypeDescription
Google\Cloud\DiscoveryEngine\V1beta\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
NameDescription
varGoogle\Cloud\DiscoveryEngine\V1beta\SearchResponse\Summary
Returns
TypeDescription
$this

getAppliedControls

Controls applied as part of the Control service.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setAppliedControls

Controls applied as part of the Control service.

Parameter
NameDescription
varstring[]
Returns
TypeDescription
$this