suggestionName = $suggestionName; $this->openSearchClient = $openSearchClient; } /** * 执行搜索操作。 * * @param \OpenSearch\Generated\Suggestion\SuggestParams $suggestParams 指定的查询条件 * @return \OpenSearch\Generated\Common\OpenSearchResult OpenSearchResult类 */ public function execute(SuggestParams $suggestParams) { $path = $this->getPath(); $builder = new SuggestUrlParamsBuilder($suggestParams); return $this->openSearchClient->get($path, $builder->getHttpParams()); } private function getPath() { return sprintf(self::SUGGESTION_API_PATH, $this->suggestionName); } /** * @deprecated */ public function search() { throw new \BadMethodCallException(); } }