laravel/framework · error · RuntimeException

This database engine does not support fulltext search…

Error message

This database engine does not support fulltext search operations.

What it means

The base Grammar's whereFullText throws by default. MySqlGrammar and PostgresGrammar override it (MySQL uses FULLTEXT indexes with MATCH...AGAINST; PostgreSQL uses tsvector/tsquery). SQLiteGrammar and SqlServerGrammar do not override it, so calling whereFullText on SQLite or SQL Server triggers the throw.

Solutions

  1. Switch to a MySQL or PostgreSQL connection — the only grammars that override whereFullText
  2. On SQLite, use whereLike with LIKE/ILIKE operators as a fallback for simple text search
  3. On SQL Server, use a raw WHERE CONTAINS clause: ->whereRaw('CONTAINS((title, body), ?)', ['search term'])
  4. In tests, use a real MySQL/PostgreSQL instance via Docker instead of SQLite

Example fix

// before — fails on SQLite / SQL Server
Article::whereFullText(['title', 'body'], 'laravel tips')->get();

// after — LIKE fallback for SQLite
Article::where('title', 'like', '%laravel tips%')->orWhere('body', 'like', '%laravel tips%')->get();
Defensive patterns

Strategy: type-guard

Validate before calling

$driver = DB::connection()->getDriverName();

if (in_array($driver, ['mysql', 'pgsql'])) {
    $query->whereFullText(['title', 'body'], 'search term');
} else {
    $query->where('title', 'like', '%search term%')
         ->orWhere('body', 'like', '%search term%');
}

Type guard

function supportsFullText(): bool {
    return in_array(DB::connection()->getDriverName(), ['mysql', 'pgsql']);
}

Try / catch

try {
    $query->whereFullText(['title', 'body'], 'search term');
} catch (\RuntimeException $e) {
    if (str_contains($e->getMessage(), 'fulltext')) {
        $query->where('title', 'like', '%search term%')
              ->orWhere('body', 'like', '%search term%');
    } else {
        throw $e;
    }
}

Prevention

When it happens

Trigger: Calling ->whereFullText(['title', 'body'], 'search term') on a SQLite (e.g., in-memory test DB) or SQL Server connection.

Common situations: Running the test suite against SQLite in-memory while production uses MySQL/PostgreSQL full-text search. Migrating from MySQL to SQL Server without updating full-text query calls.

Related errors


AI-assisted analysis of laravel/framework@e0f6eb3518 (2026-08-11). Data as JSON: /api/errors/84ad0b10970faf47. Report an issue: GitHub.

Appendix: source

Thrown at src/Illuminate/Database/Query/Grammars/Grammar.php:837

     * @return string
     */
    public function compileJsonValueCast($value)
    {
        return $value;
    }

    /**
     * Compile a "where fulltext" clause.
     *
     * @param  \Illuminate\Database\Query\Builder  $query
     * @param  array  $where
     * @return string
     *
     * @throws \RuntimeException
     */
    public function whereFullText(Builder $query, $where)
    {
        throw new RuntimeException('This database engine does not support fulltext search operations.');
    }

    /**
     * Compile a clause based on an expression.
     *
     * @param  \Illuminate\Database\Query\Builder  $query
     * @param  array  $where
     * @return string
     */
    public function whereExpression(Builder $query, $where)
    {
        return $where['column']->getValue($this);
    }

    /**
     * Compile the "group by" portions of the query.
     *
     * @param  \Illuminate\Database\Query\Builder  $query

View on GitHub (pinned to e0f6eb3518)