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

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
NameDescription
data array

Optional. Data for populating the Message object.

↳ results array<Google\Cloud\DiscoveryEngine\V1\SearchResponse\SearchResult>

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

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

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

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
var array<Google\Cloud\DiscoveryEngine\V1\SearchResponse\SearchResult>
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

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

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