All Products
Search
Document Center

SuggestParamsBuilder

Last Updated: Sep 09, 2021

Overview

The SuggestParamsBuilder class is used to construct a parameter object for a Suggest object. A SuggestParamsBuilder object can be used as a query parameter in the execute method of the SuggestClient class.

Constructor

mixed  OpenSearch\Util\SuggestParamsBuilder::__construct()

build

Creates a drop-down suggestion parameter object.

Method definition

mixed  OpenSearch\Util\SuggestParamsBuilder::build($appName, $suggestName, $query, $hits)

Parameter description

Parameter

Type

Description

$appName

mixed

The application name.

$suggestName

mixed

The name of the drop-down suggestion to be created.

$query

mixed

The query keyword of the drop-down suggestion to be created.

$hits

mixed

The number of drop-down suggestions to be displayed each time.


getQueryParams

Obtains the parameters of the current drop-down suggestion.

Method definition

mixed  OpenSearch\Util\SuggestParamsBuilder::getQueryParams($searchParams)

Parameter description

Parameter

Type

Description

$searchParams

mixed

The SearchParams object that was returned by the build method of this class.