diff --git a/Classes/Domain/Search/QueryFactory.php b/Classes/Domain/Search/QueryFactory.php index c297560..6d9fcae 100644 --- a/Classes/Domain/Search/QueryFactory.php +++ b/Classes/Domain/Search/QueryFactory.php @@ -126,7 +126,9 @@ class QueryFactory try { $fieldsToQuery = GeneralUtility::trimExplode(',', $this->configuration->get('searching.fields.query'), true); - $matchExpression['fields'] = $fieldsToQuery; + if ($fieldsToQuery !== []) { + $matchExpression['fields'] = $fieldsToQuery; + } } catch (InvalidArgumentException $e) { // Nothing configured } diff --git a/Tests/Unit/Command/IndexCommandControllerTest.php b/Tests/Unit/Command/IndexCommandControllerTest.php index bfc94a8..feb3450 100644 --- a/Tests/Unit/Command/IndexCommandControllerTest.php +++ b/Tests/Unit/Command/IndexCommandControllerTest.php @@ -108,7 +108,7 @@ class IndexCommandControllerTest extends AbstractUnitTestCase ->will($this->returnValue($indexerMock)); $indexerMock->expects($this->once()) - ->method('delete'); + ->method('deleteDocuments'); $this->subject->deleteCommand('allowedTable'); } diff --git a/Tests/Unit/Domain/Search/QueryFactoryTest.php b/Tests/Unit/Domain/Search/QueryFactoryTest.php index 704abae..570d5f0 100644 --- a/Tests/Unit/Domain/Search/QueryFactoryTest.php +++ b/Tests/Unit/Domain/Search/QueryFactoryTest.php @@ -298,7 +298,7 @@ class QueryFactoryTest extends AbstractUnitTestCase ['searching.fieldValueFactor'] ) ->will($this->onConsecutiveCalls( - '_all', + '', [ 'search_title' => 3, 'search_abstract' => 1.5, @@ -355,7 +355,7 @@ class QueryFactoryTest extends AbstractUnitTestCase ['searching.fieldValueFactor'] ) ->will($this->onConsecutiveCalls( - '_all', + '', $this->throwException(new InvalidArgumentException), $this->throwException(new InvalidArgumentException), $this->throwException(new InvalidArgumentException), @@ -526,7 +526,7 @@ class QueryFactoryTest extends AbstractUnitTestCase ['searching.fieldValueFactor'] ) ->will($this->onConsecutiveCalls( - '_all', + '', $this->throwException(new InvalidArgumentException), $this->throwException(new InvalidArgumentException), [