eZ Platform Discussions

Strange error from searchService


#1

Suddenly I experience problems with $searchService->fintContent( $query ). I get this error message:

Uncaught PHP Exception eZ\Publish\Core\Persistence\Database\QueryException: "The expression ' OR ' expected at least 1 argument but none provided." at /ezplatform/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Doctrine/DoctrineExpression.php line 78

My query is straitforward like this:

$query->query = new Query\Criterion\FullText( $searchTerm );

I’m on kernel 6.13 and use Legacy search.


#2

Check that your $searchTerm variable is not empty. As far as I know, FullText criterion does not support searching with empty string.


#3

For some reason the search term was no longer string. I cast it at such, and now it works again.