Index product properties
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!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Index product properties
Hi Aimeos,
how can I add product properties to the index, so that our customers can find a product eg. by it's SKU?
I tried to add to , but it does not seem to work...
Thanks,
Nils
how can I add product properties to the index, so that our customers can find a product eg. by it's SKU?
I tried to add
Code: Select all
product/property
Code: Select all
mshop.index.manager.standard.domains
Thanks,
Nils
Re: Index product properties
The product properties are not indexed because they can be queried directly - at least by the index manager. You can also add the necessary conditions in the 2019.x versions of the product frontend controller by using the compare() method. The only thing you have to do is to adapt the catalog lists HTML client and add the conditions for what you want to filter for.
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: Index product properties
I would love to use product properties for the keyword search, e.g. when the user searches for a SKU or MPC. Do you see any chances here, without losing too much performance?
(Using 2018.x currently...)
(Using 2018.x currently...)
Re: Index product properties
The loss in performance may be acceptable if you add conditions for filtering by some properties. It will add a JOIN to the mshop_product_property table. Just make sure the indexes from the mshop_product_property table are used.
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: Index product properties
Thank you for the reply. The query got incredibly slow after adding something like
to addFilterText(). I need to add the condition there (at the FE product controller), because I use the OR combination here but want to preserve the other filter conditions (like for disabled products etc).
The query slows down from ~10ms to ~600ms. This absolutely looks like an index is missing, but I don't know why and what I could change.
Code: Select all
$expr = array(
$filter->compare( '==', 'product.property.value', $input ),
$filter->compare( '>', $cmpfunc, 0 )
);
$textConds = $filter->combine( '||', $expr );
$expr = array(
$textConds,
$filter->getConditions()
);
The query slows down from ~10ms to ~600ms. This absolutely looks like an index is missing, but I don't know why and what I could change.
Re: Index product properties
You didn't add the type of the property you are looking for so no index is used. Furthermore, OR conditions are really slow and it's better to do two queries if possible. If you are looking for a text, you should use "=~" as operator too
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