This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Extensions » eZ Find » eZFind Indexing of array of...

eZFind Indexing of array of CustomDataTypes

eZFind Indexing of array of CustomDataTypes

Thursday 13 March 2014 12:00:13 pm - 1 reply


I do not know how to really set the indexing of an array of a customdatatype has to be set up.

My ez_class "product" has an attribute "variants". "variants" is an array of "ProductVariants". Every ProductVariant has a set of membervariables I need to index. But they still need to be linked to the Product so when I have a ProductA with a ProductVariant with the color red and a second ProductVariant with the color white and I search for the color red it should return Product A. Also when I search for the color white.

If I var_dump $content->dataMap()['variants']->attribute('content') of Product A. It returns


0 => object ProductVariant...

1 => object ProductVariant...

I have created an own datatype handler for this based on ezfSolrDocumentFieldBase. With this I can handle a ProductVariant. But how can I array of them?

public static $subattributesDefinition = array(
        self:big-smile.gif EmoticonEFAULT_SUBATTRIBUTE => 'text',
        'color' => 'text',
        'material' => 'text',
        'product_code' => 'text',
        'ean_code' => 'text',

getData() which returns an array like above with $content->dataMap()['variants']->attribute('content')[0] would work, but I must index all of $content->dataMap()['variants']->attribute('content') elements. Iterating over the array with foreach and returning


1 => subattributesDefinition array

2 => subattributesDefinition array


This would return "Failed indexing product object with ID 12345" when I run updatesearchindexsolr.php.

What do I have to do to index such an array?

Best Regars,


Friday 25 April 2014 5:17:48 pm

Hi Christian, have you tried using ezfIndexPlugin custom plugins ?

You could have one that run a piece of code that adds custom fields for you "Product" type.

Then customising search to have it look in those fields as well


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from