Make attributes and properties "searchable"
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!
- TobiasMadsen
- Posts: 14
- Joined: 04 Dec 2020, 09:57
Make attributes and properties "searchable"
Is there any way to make product attributes and more importantly properties searchable?
I would like to show the user all products with at certain attribute = something
I also have a supplier productcode as a propertie, which the user might search for.
I would like to show the user all products with at certain attribute = something
I also have a supplier productcode as a propertie, which the user might search for.
Re: Make attributes and properties "searchable"
Attributes and properties are not included in the full text search, it's only for texts but attributes can be filtered by the faceted search by default. The easiest solution is to add the properties you want to search for in an hidden text.
You can also extend the catalog/lists component and overwrite creating the search filter here:
https://github.com/aimeos/ai-client-htm ... #L697-L708
You can use the property() method of the product controller to search for properties too:
https://github.com/aimeos/ai-controller ... e.php#L138
Be aware that all conditions are combined using AND!
You can also extend the catalog/lists component and overwrite creating the search filter here:
https://github.com/aimeos/ai-client-htm ... #L697-L708
You can use the property() method of the product controller to search for properties too:
https://github.com/aimeos/ai-controller ... e.php#L138
Be aware that all conditions are combined using AND!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Make attributes and properties "searchable"
I just stumbled upon this issue, where i have faceted search, also have a group of attributes (ie. color)Be aware that all conditions are combined using AND!
each attribute has it's own id. Once I select lets say red and blue (id 2 and 3) I'm getting 0 results since it's all AND condition, and there is no product with red and blue together.
What would be a best approach to change this behaviour? There are few of such groups that will be used in the future.
I was thinking of a decorator that would group similar groups in the array and then do a IN search for product attribute.
This may work as alternative. - public function oneOf( $attrIds ) : Iface
Or maybe there is a simpler way to do this?
Re: Make attributes and properties "searchable"
The oneOf() method is the right way and you can already configure which attribute types should be OR-combined:
https://aimeos.org/docs/2020.x/config/c ... ypes-oneof
https://aimeos.org/docs/2020.x/config/c ... ypes-oneof
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star