Number of search results to return. The default value is 10.
↳ filter
string
The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. This will be used to filter search results which may affect the Answer response. If this field is unrecognizable, an INVALID_ARGUMENT is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customers might have a field 'name' in their schema. In this case the filter would look like this: filter --> name:'ANY("king kong")' For more information about filtering including syntax and filter operators, see Filter
Boost specification to boost certain documents in search results which may affect the answer query response. For more information on boosting, see Boosting
↳ order_by
string
The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. order_by expression is case-sensitive. For more information on ordering, see Ordering If this field is unrecognizable, an INVALID_ARGUMENT is returned.
↳ search_result_mode
int
Specifies the search result mode. If unspecified, the search result mode defaults to DOCUMENTS. See parse and chunk documents
Specs defining dataStores to filter on in a search call and configurations for those dataStores. This is only considered for engines with multiple dataStores use case. For single dataStore within an engine, they should use the specs at the top level.
getMaxReturnResults
Number of search results to return.
The default value is 10.
Returns
Type
Description
int
setMaxReturnResults
Number of search results to return.
The default value is 10.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getFilter
The filter syntax consists of an expression language for constructing
a predicate from one or more fields of the documents being filtered.
Filter expression is case-sensitive. This will be used to filter
search results which may affect the Answer response.
If this field is unrecognizable, an INVALID_ARGUMENT is returned.
Filtering in Vertex AI Search is done by mapping the LHS filter key
to a key property defined in the Vertex AI Search backend -- this
mapping is defined by the customer in their schema. For example a
media customers might have a field 'name' in their schema. In this
case the filter would look like this: filter --> name:'ANY("king
kong")'
For more information about filtering including syntax and filter
operators, see
Filter
Returns
Type
Description
string
setFilter
The filter syntax consists of an expression language for constructing
a predicate from one or more fields of the documents being filtered.
Filter expression is case-sensitive. This will be used to filter
search results which may affect the Answer response.
If this field is unrecognizable, an INVALID_ARGUMENT is returned.
Filtering in Vertex AI Search is done by mapping the LHS filter key
to a key property defined in the Vertex AI Search backend -- this
mapping is defined by the customer in their schema. For example a
media customers might have a field 'name' in their schema. In this
case the filter would look like this: filter --> name:'ANY("king
kong")'
For more information about filtering including syntax and filter
operators, see
Filter
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getBoostSpec
Boost specification to boost certain documents in search results which
may affect the answer query response. For more information on boosting,
see Boosting
Boost specification to boost certain documents in search results which
may affect the answer query response. For more information on boosting,
see Boosting
The order in which documents are returned. Documents can be ordered
by a field in an Document
object. Leave it unset if ordered by relevance. order_by expression
is case-sensitive. For more information on ordering, see
Ordering
If this field is unrecognizable, an INVALID_ARGUMENT is returned.
Returns
Type
Description
string
setOrderBy
The order in which documents are returned. Documents can be ordered
by a field in an Document
object. Leave it unset if ordered by relevance. order_by expression
is case-sensitive. For more information on ordering, see
Ordering
If this field is unrecognizable, an INVALID_ARGUMENT is returned.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getSearchResultMode
Specifies the search result mode. If unspecified, the
search result mode defaults to DOCUMENTS.
Specs defining dataStores to filter on in a search call and
configurations for those dataStores. This is only considered for
engines with multiple dataStores use case. For single dataStore within
an engine, they should use the specs at the top level.
Specs defining dataStores to filter on in a search call and
configurations for those dataStores. This is only considered for
engines with multiple dataStores use case. For single dataStore within
an engine, they should use the specs at the top level.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Discovery Engine V1 Client - Class SearchParams (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/php/docs/reference/cloud-discoveryengine/latest/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [1.6.1](/php/docs/reference/cloud-discoveryengine/1.6.1/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [1.5.1](/php/docs/reference/cloud-discoveryengine/1.5.1/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [1.4.0](/php/docs/reference/cloud-discoveryengine/1.4.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [1.3.3](/php/docs/reference/cloud-discoveryengine/1.3.3/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [1.2.0](/php/docs/reference/cloud-discoveryengine/1.2.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [1.1.0](/php/docs/reference/cloud-discoveryengine/1.1.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [1.0.0](/php/docs/reference/cloud-discoveryengine/1.0.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [0.11.3](/php/docs/reference/cloud-discoveryengine/0.11.3/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [0.8.0](/php/docs/reference/cloud-discoveryengine/0.8.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [0.7.1](/php/docs/reference/cloud-discoveryengine/0.7.1/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [0.6.0](/php/docs/reference/cloud-discoveryengine/0.6.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [0.5.0](/php/docs/reference/cloud-discoveryengine/0.5.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [0.4.0](/php/docs/reference/cloud-discoveryengine/0.4.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [0.3.0](/php/docs/reference/cloud-discoveryengine/0.3.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [0.2.0](/php/docs/reference/cloud-discoveryengine/0.2.0/V1.AnswerQueryRequest.SearchSpec.SearchParams)\n- [0.1.1](/php/docs/reference/cloud-discoveryengine/0.1.1/V1.AnswerQueryRequest.SearchSpec.SearchParams) \nReference documentation and code samples for the Google Cloud Discovery Engine V1 Client class SearchParams.\n\nSearch parameters.\n\nGenerated from protobuf message `google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchParams`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ DiscoveryEngine \\\\ V1 \\\\ AnswerQueryRequest \\\\ SearchSpec\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getMaxReturnResults\n\nNumber of search results to return.\n\nThe default value is 10.\n\n### setMaxReturnResults\n\nNumber of search results to return.\n\nThe default value is 10.\n\n### getFilter\n\nThe filter syntax consists of an expression language for constructing\na predicate from one or more fields of the documents being filtered.\n\nFilter expression is case-sensitive. This will be used to filter\nsearch results which may affect the Answer response.\nIf this field is unrecognizable, an `INVALID_ARGUMENT` is returned.\nFiltering in Vertex AI Search is done by mapping the LHS filter key\nto a key property defined in the Vertex AI Search backend -- this\nmapping is defined by the customer in their schema. For example a\nmedia customers might have a field 'name' in their schema. In this\ncase the filter would look like this: filter --\\\u003e name:'ANY(\"king\nkong\")'\nFor more information about filtering including syntax and filter\noperators, see\n[Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)\n\n### setFilter\n\nThe filter syntax consists of an expression language for constructing\na predicate from one or more fields of the documents being filtered.\n\nFilter expression is case-sensitive. This will be used to filter\nsearch results which may affect the Answer response.\nIf this field is unrecognizable, an `INVALID_ARGUMENT` is returned.\nFiltering in Vertex AI Search is done by mapping the LHS filter key\nto a key property defined in the Vertex AI Search backend -- this\nmapping is defined by the customer in their schema. For example a\nmedia customers might have a field 'name' in their schema. In this\ncase the filter would look like this: filter --\\\u003e name:'ANY(\"king\nkong\")'\nFor more information about filtering including syntax and filter\noperators, see\n[Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)\n\n### getBoostSpec\n\nBoost specification to boost certain documents in search results which\nmay affect the answer query response. For more information on boosting,\nsee [Boosting](https://cloud.google.com/retail/docs/boosting#boost)\n\n### hasBoostSpec\n\n### clearBoostSpec\n\n### setBoostSpec\n\nBoost specification to boost certain documents in search results which\nmay affect the answer query response. For more information on boosting,\nsee [Boosting](https://cloud.google.com/retail/docs/boosting#boost)\n\n### getOrderBy\n\nThe order in which documents are returned. Documents can be ordered\nby a field in an [Document](/php/docs/reference/cloud-discoveryengine/latest/V1.Document)\nobject. Leave it unset if ordered by relevance. `order_by` expression\nis case-sensitive. For more information on ordering, see\n[Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)\nIf this field is unrecognizable, an `INVALID_ARGUMENT` is returned.\n\n### setOrderBy\n\nThe order in which documents are returned. Documents can be ordered\nby a field in an [Document](/php/docs/reference/cloud-discoveryengine/latest/V1.Document)\nobject. Leave it unset if ordered by relevance. `order_by` expression\nis case-sensitive. For more information on ordering, see\n[Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)\nIf this field is unrecognizable, an `INVALID_ARGUMENT` is returned.\n\n### getSearchResultMode\n\nSpecifies the search result mode. If unspecified, the\nsearch result mode defaults to `DOCUMENTS`.\n\nSee [parse and chunk\ndocuments](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)\n\n### setSearchResultMode\n\nSpecifies the search result mode. If unspecified, the\nsearch result mode defaults to `DOCUMENTS`.\n\nSee [parse and chunk\ndocuments](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)\n\n### getDataStoreSpecs\n\nSpecs defining dataStores to filter on in a search call and\nconfigurations for those dataStores. This is only considered for\nengines with multiple dataStores use case. For single dataStore within\nan engine, they should use the specs at the top level.\n\n### setDataStoreSpecs\n\nSpecs defining dataStores to filter on in a search call and\nconfigurations for those dataStores. This is only considered for\nengines with multiple dataStores use case. For single dataStore within\nan engine, they should use the specs at the top level."]]