Index product attributes

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
nvindice
Posts: 27
Joined: 16 May 2019, 16:20

Index product attributes

Post by nvindice » 22 Nov 2021, 16:50

Hi Aimeos team,

in 2018.x, all product attributes were indexed into mshop_index_text, so that products could be searched via their attributes. In 2021.x, I can't make this work.

What do I need to configure to search products by their attributes with the default search function?

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

Re: Index product attributes

Post by aimeos » 23 Nov 2021, 15:47

In 2018.x this consisted of a lot of ugly code and had been removed after a rewrite. Up to now, no one besides you has asked for that again :-)

In the new source it's rather easy to add that again:
https://github.com/aimeos/aimeos-core/b ... #L728-L739

You can add something like this:

Code: Select all

foreach( $product->getRefItems( 'attribute' ) as $attrItem ) {
	$texts[$langId]['content'][] = $attrItem->getName();
}
If you create a PR, there should be no problem to add that feature again into the core.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

nvindice
Posts: 27
Joined: 16 May 2019, 16:20

Re: Index product attributes

Post by nvindice » 24 Nov 2021, 09:41

Thanks for the reply, I already solved it exactly this way (and added some configuration to prevent hidden attributes by default).

I'll be happy to make a PR!

Post Reply