Builds the parameter object for drop-down suggestion queries in the OpenSearch PHP SDK. Pass the built object to the execute method of a SuggestClient instance to run the query.
Methods
__construct()
Creates a SuggestParamsBuilder instance.
Method signature
mixed OpenSearch\Util\SuggestParamsBuilder::__construct()build()
Builds a drop-down suggestion parameter object to pass to SuggestClient::execute().
Method signature
mixed OpenSearch\Util\SuggestParamsBuilder::build($appName, $suggestName, $query, $hits)Parameters
| Parameter | Type | Description |
|---|---|---|
$appName | mixed | The OpenSearch application name. |
$suggestName | mixed | The name of the drop-down suggestion configured in the application. |
$query | mixed | The keyword to retrieve suggestions for. |
$hits | mixed | The number of suggestions to return. |
getQueryParams()
Returns the query parameters from a SearchParams object built by build().
Method signature
mixed OpenSearch\Util\SuggestParamsBuilder::getQueryParams($searchParams)Parameters
| Parameter | Type | Description |
|---|---|---|
$searchParams | mixed | The SearchParams object returned by the build() method of this class. |
该文章对您有帮助吗?