Author: mj
Date: Mon Oct 24 15:05:42 2011
New Revision: 10177
Log:
Fixes #2126 (name access points not searchable).
Modified:
trunk/lib/QubitSearch.class.php
trunk/lib/model/QubitInformationObject.php
Modified: trunk/lib/QubitSearch.class.php
==============================================================================
--- trunk/lib/QubitSearch.class.php Mon Oct 24 14:09:28 2011 (r10176)
+++ trunk/lib/QubitSearch.class.php Mon Oct 24 15:05:42 2011 (r10177)
@@ -483,7 +483,10 @@
$doc->addField(Zend_Search_Lucene_Field::UnIndexed('dates',
serialize($dates)));
// CREATOR
- $doc->addField(Zend_Search_Lucene_Field::Unstored('creator',
$informationObject->getCreatorsNameString(array('culture' => $language))));
+ $creatorField = Zend_Search_Lucene_Field::Unstored('creator',
$informationObject->getCreatorsNameString(array('culture' => $language)));
+ // Boost the hit relevance for the creator field
+ $creatorField->boost = 8;
+ $doc->addField($creatorField);
$doc->addField(Zend_Search_Lucene_Field::Unstored('creatorhistory',
$informationObject->getCreatorsHistoryString(array('culture' => $language))));
// Level of Description
Modified: trunk/lib/model/QubitInformationObject.php
==============================================================================
--- trunk/lib/model/QubitInformationObject.php Mon Oct 24 14:09:28 2011
(r10176)
+++ trunk/lib/model/QubitInformationObject.php Mon Oct 24 15:05:42 2011
(r10177)
@@ -858,15 +858,15 @@
{
$nameAccessPointString = '';
- $names = $this->getActors();
- if ($names)
- {
- $culture = (isset($options['culture'])) ? $options['culture'] :
sfContext::getInstance()->user->getCulture();
+ $criteria = new Criteria;
+ $criteria->add(QubitRelation::SUBJECT_ID, $this->id);
+ $criteria->add(QubitRelation::TYPE_ID, QubitTerm::NAME_ACCESS_POINT_ID);
- foreach ($names as $name)
- {
- $nameAccessPointString .=
$name->getAuthorizedFormOfName(array('culture' => $culture)).' ';
- }
+ $culture = (isset($options['culture'])) ? $options['culture'] :
sfContext::getInstance()->user->getCulture();
+
+ foreach ($this->nameAccessPoints = QubitRelation::get($criteria) as $name)
+ {
+ $nameAccessPointString .=
$name->object->getAuthorizedFormOfName(array('culture' => $culture)).' ';
}
return $nameAccessPointString;
--
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.