Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fulltext-search with SearchableText() not working for mariadb #6721

Closed
chbister opened this issue Feb 5, 2025 · 1 comment
Closed

Fulltext-search with SearchableText() not working for mariadb #6721

chbister opened this issue Feb 5, 2025 · 1 comment
Labels
bug Verified bug by the Nova team fix incoming A fix is in review

Comments

@chbister
Copy link

chbister commented Feb 5, 2025

  • Laravel Version: Laravel Framework 11.41.3
  • Nova Version: v5.1.10 (Silver Surfer)
  • PHP Version: 8.3.15
  • Database Driver & Version: mariadb, 11.5.2-MariaDB-ubu2404
  • Operating System and Version: Linux foobar 6.1.0-30-amd64 Unable to compile laravel-nova JS #1 SMP PREEMPT_DYNAMIC Debian 6.1.124-1 (2025-01-12) x86_64 GNU/Linux

Description:

When using "mariadb" database driver the usage of SearchableText() in searchableColumns() in a Resource class does not add the fulltext query part thus returning no search results.

public static function searchableColumns(): array
{
    return [new SearchableText('name')];
}

I guess issue lies within vendor/laravel/nova/src/Query/Search/SearchableText.php in following line, as $connectionType='mariadb' is not handled.

if (in_array($connectionType, ['mysql', 'pgsql'])) {

Should be like this:

if (in_array($connectionType, ['mariadb', 'mysql', 'pgsql'])) {

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. create a new migration and model, set $table->fullText('<column_name>') in the migration for the desired text column
  2. create a new Resource for a model
  3. remove the static $search variable
  4. create the searchableColumns() function as described here: https://nova.laravel.com/docs/v5/search/the-basics#full-text-indexes
  5. set DB_CONNECTION=mysql in .env to see it working
  6. set DB_CONNECTION=mariadb in .env to see it failing
@crynobone crynobone added bug Verified bug by the Nova team fix incoming A fix is in review labels Feb 6, 2025
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Projects
None yet
Development

No branches or pull requests

2 participants