Author: david
Date: Fri Feb 10 14:44:00 2012
New Revision: 10858

Log:
Add identifier.  Copy changes from r10840 and r10843

Modified:
   trunk/lib/QubitSearchPdo.class.php

Modified: trunk/lib/QubitSearchPdo.class.php
==============================================================================
--- trunk/lib/QubitSearchPdo.class.php  Fri Feb 10 14:36:42 2012        (r10857)
+++ trunk/lib/QubitSearchPdo.class.php  Fri Feb 10 14:44:00 2012        (r10858)
@@ -175,6 +175,14 @@
     $doc->addField(Zend_Search_Lucene_Field::UnIndexed('parent_id', 
$resource->parent_id));
     $doc->addField(Zend_Search_Lucene_Field::Keyword('parent', 
$resource->parent->slug));
 
+    // Identifier
+    $identifierField = Zend_Search_Lucene_Field::Text('identifier', 
$resource->identifier());
+    $identifierField->boost = 5;
+    $doc->addField($identifierField);
+
+    // Reference code
+    //$doc->addField(Zend_Search_Lucene_Field::Text('referenceCode', 
$resource->referenceCode));
+
     // Title
     // Include an i18n fallback for proper search result display in case the
     // title field was not translated
@@ -261,12 +269,13 @@
     // Level of description
     if (null !== $resource->level_of_description_id)
     {
-      $lod = self::getLevelOfDescription($resource->level_of_description_id, 
$language);
-      $doc->addField(Zend_Search_Lucene_Field::Keyword('levelOfDescription', 
$lod));
+      $doc->addField(Zend_Search_Lucene_Field::Keyword('levelOfDescription', 
self::getLevelOfDescription($resource->level_of_description_id, $language)));
+      $doc->addField(Zend_Search_Lucene_Field::Keyword('levelOfDescriptionId', 
$resource->level_of_description_id));
     }
     else
     {
       $doc->addField(Zend_Search_Lucene_Field::UnIndexed('levelOfDescription', 
null));
+      
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('levelOfDescriptionId', 
null));
     }
 
     self::getInstance()->getEngine()->getIndex()->addDocument($doc);
@@ -294,8 +303,6 @@
       $doc->addField(Zend_Search_Lucene_Field::Keyword('hasDigitalObject', 
'false'));
     }
 
-    $doc->addField(Zend_Search_Lucene_Field::Text('referenceCode', 
$resource->referenceCode));
-
     // Store dates as serialized array
     $dates = array();
     foreach ($resource->getDates() as $date)
@@ -321,11 +328,6 @@
     $doc->addField($creatorField);
     $doc->addField(Zend_Search_Lucene_Field::Unstored('creatorhistory', 
$resource->getCreatorsHistoryString(array('culture' => $language))));
 
-    // Identifier
-    $identifierField = Zend_Search_Lucene_Field::Text('identifier', 
$resource->getIdentifier());
-    $identifierField->boost = 5;
-    $doc->addField($identifierField);
-
     // Subjects
     $subjectField = Zend_Search_Lucene_Field::Unstored('subject', 
$resource->getAccessPointsString(QubitTaxonomy::SUBJECT_ID, array('culture' => 
$language)));
     // Boost the hit relevance for the subject field

-- 
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