public function getSphinxFieldType($fieldName)
 {
     $sphinxTypes = TagSearchPlugin::getSphinxSchemaFields();
     if (!isset($sphinxTypes[$fieldName])) {
         return null;
     }
     return kSphinxSearchManager::getSphinxDataType($sphinxTypes[$fieldName]);
 }
Ejemplo n.º 2
0
 /**
  * @param int $categoryId
  * @param string $pcToDecrement
  * @param string $pcToIncrement
  * @return BatchJob
  */
 protected static function addReIndexTagsJob($categoryId, $pcToDecrement, $pcToIncrement, $partnerId = null)
 {
     $jobType = TagSearchPlugin::getBatchJobTypeCoreValue(IndexTagsByPrivacyContextJobType::INDEX_TAGS);
     $data = new kIndexTagsByPrivacyContextJobData();
     $data->setChangedCategoryId($categoryId);
     $data->setDeletedPrivacyContexts($pcToDecrement);
     $data->setAddedPrivacyContexts($pcToIncrement);
     $batchJob = new BatchJob();
     $batchJob->setObjectId($categoryId);
     $batchJob->setObjectType(BatchJobObjectType::CATEGORY);
     if (!$partnerId) {
         $partnerId = kCurrentContext::getCurrentPartnerId();
     }
     $batchJob->setPartnerId($partnerId);
     KalturaLog::log("Creating tag re-index job for categoryId [" . $data->getChangedCategoryId() . "] ");
     return kJobsManager::addJob($batchJob, $data, $jobType);
 }