eZ Community » Forums » Developer » ezFind - find class objects by node...
expandshrink

ezFind - find class objects by node and parent node field

ezFind - find class objects by node and parent node field

Monday 17 June 2013 10:16:34 am - 3 replies

Hello.

I have a problem with proper query to ezFind (version 5).

I created two content classes (ClassA, ClassB). I created content objects in the tree. Objects of ClassB are children of ClassA objects.

 - objectA1 [ClassA]:
 - - objectB1 [ClassB]
 - - objectB2 [ClassB]
 - - objectB3 [ClassB]

I would like to find ClassB objects by node and parent node fields.
For example: ClassA.field1=123 AND ClassB.field1=300, where 113 is root nodeID.

Here are queries which I have tried:

    fetch( ezfind, search, hash( 'query', '*',
              'class_id', array('ClassA', 'ClassB'),             
              'subtree_array', array( 113 ),             
              'filter', array('and', 
                 array( 'ClassA/field1:1234'),
                 array( 'ClassB/field2:[123 TO 400]')
                 )
               )
         ) )

Return 0 result.

     fetch( ezfind, search, hash( 'query', '*',
              'class_id', array('ClassA', 'ClassB'),             
              'subtree_array', array( 113 ),             
              'filter', array('ClassA/field1:1234', 'ClassB/field2:[123 TO 400]')
             ) )

Return 0 result.

Can you point me to the in right direction?

Monday 17 June 2013 10:36:40 am

HiYou can't to this out of the box as the data from parent (except system meta data like node_id) is not indexed in the child solr document. You need to use http://projects.ez.no/ezindexer to configure this. Once the data from parent is indexed with the child node you will be able to do a filter you need

Monday 17 June 2013 12:43:30 pm

Quote from Ivo Lukač :

You need to use http://projects.ez.no/ezindexer to configure this.

Thank you.

Where I find documentation or examples ezindexer project?

Monday 17 June 2013 12:53:08 pm

Well, either on the project page or in the extension it self. There is probably no extra docs for a small extension like this.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from