Author: david
Date: Fri Oct 15 10:43:59 2010
New Revision: 8157

Log:
Add other forms of name to search index. Fixes issue #1691.

Modified:
   trunk/lib/model/QubitActor.php

Modified: trunk/lib/model/QubitActor.php
==============================================================================
--- trunk/lib/model/QubitActor.php      Fri Oct 15 10:41:42 2010        (r8156)
+++ trunk/lib/model/QubitActor.php      Fri Oct 15 10:43:59 2010        (r8157)
@@ -158,6 +158,22 @@
         
$doc->addField(Zend_Search_Lucene_Field::UnStored('authorizedFormOfName', 
$actorI18n->authorizedFormOfName));
       }
 
+      // Add other forms of name for this culture
+      $criteria = new Criteria;
+      $criteria->addJoin(QubitOtherNameI18n::ID, QubitOtherName::ID);
+      $criteria->add(QubitOtherNameI18n::CULTURE, $actorI18n->culture);
+      $criteria->add(QubitOtherName::OBJECT_ID, $this->id);
+
+      if (0 < count($otherNameI18ns = QubitOtherNameI18n::get($criteria)))
+      {
+        foreach ($otherNameI18ns as $otherNameI18n)
+        {
+          $otherNames[] = $otherNameI18n->name;
+        }
+
+        $doc->addField(Zend_Search_Lucene_Field::UnStored('otherFormsOfName', 
implode(' ', $otherNames)));
+      }
+
       $search->getEngine()->getIndex()->addDocument($doc);
     }
 

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to