Google Cloud Retail V2 Client - Class SearchResponse (1.4.2)

Reference documentation and code samples for the Google Cloud Retail V2 Client class SearchResponse.

Response message for SearchService.Search method.

Generated from protobuf message google.cloud.retail.v2.SearchResponse

Namespace

Google \ Cloud \ Retail \ V2

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ results array<Google\Cloud\Retail\V2\SearchResponse\SearchResult>

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

↳ facets array<Google\Cloud\Retail\V2\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.

↳ 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.

↳ 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.

↳ 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.

↳ query_expansion_info Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo

Query expansion information for the returned results.

↳ 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.

↳ applied_controls array

The fully qualified resource name of applied controls.

↳ invalid_condition_boost_specs array<Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>

The invalid SearchRequest.BoostSpec.condition_boost_specs that are not applied during serving.

↳ experiment_info array<Google\Cloud\Retail\V2\ExperimentInfo>

Metadata related to A/B testing Experiment associated with this response. Only exists when an experiment is triggered.

getResults

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

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setResults

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

Parameter
NameDescription
var array<Google\Cloud\Retail\V2\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
var array<Google\Cloud\Retail\V2\SearchResponse\Facet>
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
var int
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
var string
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
var string
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
var string
Returns
TypeDescription
$this

getQueryExpansionInfo

Query expansion information for the returned results.

Returns
TypeDescription
Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo|null

hasQueryExpansionInfo

clearQueryExpansionInfo

setQueryExpansionInfo

Query expansion information for the returned results.

Parameter
NameDescription
var Google\Cloud\Retail\V2\SearchResponse\QueryExpansionInfo
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
var string
Returns
TypeDescription
$this

getAppliedControls

The fully qualified resource name of applied controls.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setAppliedControls

The fully qualified resource name of applied controls.

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getInvalidConditionBoostSpecs

The invalid SearchRequest.BoostSpec.condition_boost_specs that are not applied during serving.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setInvalidConditionBoostSpecs

The invalid SearchRequest.BoostSpec.condition_boost_specs that are not applied during serving.

Parameter
NameDescription
var array<Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>
Returns
TypeDescription
$this

getExperimentInfo

Metadata related to A/B testing Experiment associated with this response. Only exists when an experiment is triggered.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setExperimentInfo

Metadata related to A/B testing Experiment associated with this response. Only exists when an experiment is triggered.

Parameter
NameDescription
var array<Google\Cloud\Retail\V2\ExperimentInfo>
Returns
TypeDescription
$this