Adding a column from products table to searchable index so that all products with specific column value can be searched
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Adding a column from products table to searchable index so that all products with specific column value can be searched
I have added new addition column as tags in the database. This tags are attached to every product so that i can select all products with particular tag assigned to it. Its similar like "New Product" tag or "Best Seller" tag. I am not able to understand how i can search all those products based on that tags column.
Like getting all products with Tag "Best Seller". I was trying to do the search based on column index but i am not able to understand how i can add that column in searchable index in aimeos.
Please guide me for the same.
Below is the database snap of products. Here i need to select products based on a particular theme for search page display
Like getting all products with Tag "Best Seller". I was trying to do the search based on column index but i am not able to understand how i can add that column in searchable index in aimeos.
Please guide me for the same.
Below is the database snap of products. Here i need to select products based on a particular theme for search page display
Re: Adding a column from products table to searchable index so that all products with specific column value can be searc
If you create a decorator for the product manager, you can also search for new properties:
https://aimeos.org/docs/latest/models/e ... /#easy-way
https://aimeos.org/docs/latest/models/e ... /#easy-way
Code: Select all
$manager = \Aimeos\MShop::create( $context, 'product' );
$filter = $manager->filter()->add( 'tags', '==', 'Best Seller' );
$items = $manager->search( $filter );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Adding a column from products table to searchable index so that all products with specific column value can be searc
Thank you for the details. I tried the method given by you but that is not returning all data required for database display in frontend. The manager which we use for other searches is as follows
This returns perfect data for frontend but when i use the manager mentioned by you, it is not returning images. it returns data which can be displayed moreover for backend. below is the snap of how data is returned
it returns proper with frontend manager
This returns perfect data for frontend but when i use the manager mentioned by you, it is not returning images. it returns data which can be displayed moreover for backend. below is the snap of how data is returned
it returns proper with frontend manager
Re: Adding a column from products table to searchable index so that all products with specific column value can be searc
In that case, use the frontend product controller from your screenshot and add this for filtering by tags:
See: https://github.com/aimeos/ai-controller ... ce.php#L62
Code: Select all
->compare( '==', 'tags', 'Best seller' )
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Adding a column from products table to searchable index so that all products with specific column value can be searc
I have added this condition as given by you, but if the search term themes is not added then it not returning anything. I need to make the search in way where if the filter is added then it should return filtered results as per condition or else it should return the results without this condition. Currently if condition is sent blank then it is comparing it as blank and not returning the result.
Re: Adding a column from products table to searchable index so that all products with specific column value can be searc
Place your condition between the create() and search() methods in an if() condition:
Code: Select all
$cntl = \Aimeos\Controller\Frontend::create( $context, 'product' );
if( $theme = $view->param( 'f_theme' ) ) {
$cnt->compare( '==', 'themes', $theme );
}
$products = $cntl->...()->search();
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
