Skip to content

Commit c0d0cdf

Browse files
committed
TASK: Fix order of arguments in suggest controller
1 parent 6758657 commit c0d0cdf

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Classes/Controller/SuggestController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ public function initializeObject()
5656
}
5757

5858
/**
59+
* @param string $term
5960
* @param string $contextNodeIdentifier
6061
* @param string $dimensionCombination
61-
* @param string $term
6262
* @return void
6363
* @throws QueryBuildingException
6464
*/
65-
public function indexAction($contextNodeIdentifier, $dimensionCombination, $term)
65+
public function indexAction($term, $contextNodeIdentifier, $dimensionCombination)
6666
{
6767
if ($this->elasticSearchClient === null) {
6868
throw new \RuntimeException('The SuggestController needs an ElasticSearchClient, it seems you run without the flowpack/elasticsearch-contentrepositoryadaptor package, though.', 1487189823);
@@ -79,7 +79,7 @@ public function indexAction($contextNodeIdentifier, $dimensionCombination, $term
7979
return;
8080
}
8181

82-
$requestJson = $this->buildRequestForTerm($contextNodeIdentifier, $dimensionCombination, $term);
82+
$requestJson = $this->buildRequestForTerm($term, $contextNodeIdentifier, $dimensionCombination);
8383

8484
try {
8585
$response = $this->elasticSearchClient->getIndex()->request('POST', '/_search', [], $requestJson)->getTreatedContent();
@@ -99,7 +99,7 @@ public function indexAction($contextNodeIdentifier, $dimensionCombination, $term
9999
* @return ElasticSearchQueryBuilder
100100
* @throws QueryBuildingException
101101
*/
102-
protected function buildRequestForTerm($contextNodeIdentifier, $dimensionCombination, $term)
102+
protected function buildRequestForTerm($term, $contextNodeIdentifier, $dimensionCombination = null)
103103
{
104104
$cacheKey = $contextNodeIdentifier . '-' . md5($dimensionCombination);
105105
$termPlaceholder = '---term-soh2gufuNi---';

0 commit comments

Comments
 (0)