Make filter in back-end not case sensitive ?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
IvanIgniter
Posts: 58
Joined: 01 Dec 2021, 07:41

Re: Make filter in back-end not case sensitive ?

Post by IvanIgniter » 05 Sep 2022, 08:26

Sorry if I am not specific where to search.
It is `code` varbinary(64) column that I was concern case insensitive is not working not the label field.
Searching in label field in case-insensitive text is working fine but in code field varbinary datatype has issue in case-insensitive filter.
Do you have any idea how to make our search case-insensitive work?

User avatar
aimeos
Administrator
Posts: 7881
Joined: 01 Jan 1970, 00:00

Re: Make filter in back-end not case sensitive ?

Post by aimeos » 06 Sep 2022, 08:48

Change the code column from VARBINARY to VARCHAR and utf8mb4_general_ci collection.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
IvanIgniter
Posts: 58
Joined: 01 Dec 2021, 07:41

Re: Make filter in back-end not case sensitive ?

Post by IvanIgniter » 07 Sep 2022, 06:35

Yeah.. how I wish we could easily change as easy as that. It is already in production in a dockerized server.
I wonder where to change the migration of the aimoes or a refence how to reconfigure the default product table?

I hava tried to do this without error but only the length and not null only reflected. The change type to string does not work. Any idea why?
set type.jpg
set type.jpg (89.72 KiB) Viewed 1049 times
$table->getColumn('code')->setType(Type::getType(Types::STRING))->setLength( 40 )->setNotnull();
reference: https://aimeos.org/docs/2021.x/infrastr ... ing-tables

User avatar
aimeos
Administrator
Posts: 7881
Joined: 01 Jan 1970, 00:00

Re: Make filter in back-end not case sensitive ?

Post by aimeos » 08 Sep 2022, 09:15

Have you tried changeColumn() like written in the referred docs?

Code: Select all

$table->changeColumn(  'value', ['length' => 64, 'customSchemaOptions' => ['charset' => 'utf8mb4', 'collation' => 'utf8mb4_general_ci'] );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
IvanIgniter
Posts: 58
Joined: 01 Dec 2021, 07:41

Re: Make filter in back-end not case sensitive ?

Post by IvanIgniter » 12 Sep 2022, 06:16

Yes, I did those codes and more but I still have no luck.
run 2.jpg
run 2.jpg (105.1 KiB) Viewed 1031 times
run 1.jpg
run 1.jpg (114.18 KiB) Viewed 1031 times
I believe that changeColumn() is to set the properties if not changing the data type and setType to change data type.
Any idea why this is causing issue or a solution to change data type?

User avatar
aimeos
Administrator
Posts: 7881
Joined: 01 Jan 1970, 00:00

Re: Make filter in back-end not case sensitive ?

Post by aimeos » 12 Sep 2022, 17:01

The error is now that MySQL can't change the column to case-insensitive because there are the same strings in different cases and there's also a unique constraint. You have to cleanup the column values first.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
IvanIgniter
Posts: 58
Joined: 01 Dec 2021, 07:41

Re: Make filter in back-end not case sensitive ?

Post by IvanIgniter » 14 Sep 2022, 07:46

Thank you that works after we have to remove all of the products.
Seems like there is no other ways if we don't removed the saved products.

Thanks you..

Post Reply