Author: pb
Date: Sat Apr 25 21:45:37 2009
New Revision: 3882

Log:
- added all parent node path ids to path field: need subtree filters on all 
node locations (preliminary code)

Modified:
    ezfind/ezp4/trunk/extension/ezfind/search/plugins/ezsolr/ezsolr.php
Modified: ezfind/ezp4/trunk/extension/ezfind/search/plugins/ezsolr/ezsolr.php
==============================================================================
--- ezfind/ezp4/trunk/extension/ezfind/search/plugins/ezsolr/ezsolr.php (original)
+++ ezfind/ezp4/trunk/extension/ezfind/search/plugins/ezsolr/ezsolr.php Sat Apr 25 21:45:37 2009
@@ -261,12 +261,15 @@
         }
         // Get global object values
         $mainNode = $contentObject->attribute( 'main_node' );
+        // initialize array of parent node path ids, needed for multivalued path field and subtree filters
+        $nodePathArray = array();
         if ( !$mainNode )
         {
             eZDebug::writeError( 'Unable to fetch main node for object: ' . $contentObject->attribute( 'id' ), 'eZSolr::addObject()' );
             return;
         }
-        $pathArray = $mainNode->attribute( 'path_array' );
+        //included in $nodePathArray
+        //$pathArray = $mainNode->attribute( 'path_array' );
         $currentVersion = $contentObject->currentVersion();
 
         // Get object meta attributes.
@@ -288,6 +291,8 @@
                                                 'value' => $contentNode->attribute( $attributeName ),
                                                 'fieldType' => $fieldType );
             }
+            $nodePathArray[] = $contentNode->attribute( 'path_array' );
+
         }
 
         //  Create the list of available languages for this version :
@@ -384,9 +389,13 @@
             // Add main url_alias
             $doc->addField( self::getMetaFieldName( 'main_url_alias' ), $mainNode->attribute( 'url_alias' ) );
 
-            foreach ( $pathArray as $pathNodeID )
-            {
-                $doc->addField( self::getMetaFieldName( 'path' ), $pathNodeID );
+            // add nodeid of all parent nodes path elements
+            foreach ( $nodePathArray as $pathArray )
+            {
+                foreach ( $pathArray as $pathNodeID)
+                {
+                    $doc->addField( self::getMetaFieldName( 'path' ), $pathNodeID );
+                }
             }
 
             eZContentObject::recursionProtectionStart();

_______________________________________________
svn-eZFind mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-ezfind

Reply via email to