CRUD: Table search not working properly

I switched from V3.2 to V3.3 and it’s awesome that ajax search is enabled by default and that relations are working as expected.

I have a huge table with more than 10k+ movies and another table with more than 2k+ series. The problem now is that the tablesearch mostly won’t return any result.

Database structure: movie_id | title | other columns.

If I now search for example for: Trick’r Treat oder just Trick I don’t get any result. The same occurs for many other movies like Lucy, Project X etc. but some are working like: Matrix. The same behaviour occurs for the series table.

I don’t know if this matters but i have multiple 1-n relationships like:

$this->crud->addColumn([
            // 1-n relationship
            'label' => "Author", // Table column heading
            'type' => "select",
            'name' => 'id', // the column that contains the ID of that connected entity;
            'entity' => 'user', // the method that defines the relationship in your Model
            'attribute' => "name", // foreign key attribute that is shown to user
            'model' => "App\Models\User", // foreign key model
        ]);

Before the update it worked perfect. Why am I getting mostly no results anymore?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (14 by maintainers)

Most upvoted comments

I took a look at the applySearchLogicForColumn Code and it helped me thanks. Because I have my own column the type didn’t match with the default ones.

Okay sure

think spatie api query builder does LOWER(…) for it’s filter but that’s them

Thanks for the reply 😃

I didn’t need such a behavior yet. As I understand it, this is primarily a database thing rather then code. So I would suggest to use a case sensitive collation on your database instead.