當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZSolr::engineText方法代碼示例

本文整理匯總了PHP中eZSolr::engineText方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZSolr::engineText方法的具體用法?PHP eZSolr::engineText怎麽用?PHP eZSolr::engineText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZSolr的用法示例。


在下文中一共展示了eZSolr::engineText方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: attribute


//.........這裏部分代碼省略.........
                         break;
                         // author facet field
                     // author facet field
                     case eZSolr::getMetaFieldName('owner_id'):
                         $fieldInfo = array('field' => 'author', 'count' => count($facetField), 'nameList' => array(), 'queryLimit' => array(), 'fieldList' => array(), 'countList' => array());
                         foreach ($facetField as $ownerID => $count) {
                             if ($owner = eZContentObject::fetch($ownerID)) {
                                 $fieldInfo['nameList'][$ownerID] = $owner->attribute('name');
                                 $fieldInfo['queryLimit'][$ownerID] = 'owner_id:' . $ownerID;
                                 $fieldInfo['countList'][$ownerID] = $count;
                                 $fieldInfo['fieldList'][$ownerID] = 'owner_id';
                             } else {
                                 eZDebug::writeWarning('Could not fetch owner ( eZContentObject ): ' . $ownerID, __METHOD__);
                             }
                         }
                         $facetArray[] = $fieldInfo;
                         break;
                         // translation facet field
                     // translation facet field
                     case eZSolr::getMetaFieldName('language_code'):
                         $fieldInfo = array('field' => 'translation', 'count' => count($facetField), 'nameList' => array(), 'queryLimit' => array(), 'fieldList' => array(), 'countList' => array());
                         foreach ($facetField as $languageCode => $count) {
                             $fieldInfo['nameList'][$languageCode] = $languageCode;
                             $fieldInfo['queryLimit'][$languageCode] = 'language_code:' . $languageCode;
                             $fieldInfo['fieldList'][$languageCode] = 'language_code';
                             $fieldInfo['countList'][$languageCode] = $count;
                         }
                         $facetArray[] = $fieldInfo;
                         break;
                     default:
                         $fieldInfo = array('field' => $attr, 'count' => count($facetField), 'queryLimit' => array(), 'fieldList' => array(), 'nameList' => array(), 'countList' => array());
                         foreach ($facetField as $value => $count) {
                             $fieldInfo['nameList'][$value] = $value;
                             $fieldInfo['fieldList'][$value] = $field;
                             $fieldInfo['queryLimit'][$value] = $field . ':' . $value;
                             $fieldInfo['countList'][$value] = $count;
                         }
                         $facetArray[] = $fieldInfo;
                         break;
                 }
             }
             $this->FacetFields = $facetArray;
             return $this->FacetFields;
             break;
         case 'engine':
             return eZSolr::engineText();
             break;
             //may or may not be active, so returns false if not present
         //may or may not be active, so returns false if not present
         case 'spellcheck':
             if (isset($this->ResultArray['spellcheck']) && $this->ResultArray['spellcheck']['suggestions'] > 0) {
                 return $this->ResultArray['spellcheck']['suggestions'];
             } else {
                 return false;
             }
             break;
         case 'spellcheck_collation':
             if (isset($this->ResultArray['spellcheck']['suggestions']['collation'])) {
                 // work around border case if 'collation' is searched for but does not exist in the spell check index
                 // the collation string is the last element of the suggestions array
                 return end($this->ResultArray['spellcheck']['suggestions']);
             } else {
                 return false;
             }
             break;
             //only relevant for MoreLikeThis queries
         //only relevant for MoreLikeThis queries
         case 'interestingTerms':
             if (isset($this->ResultArray['interestingTerms'])) {
                 return $this->ResultArray['interestingTerms'];
             } else {
                 return false;
             }
             break;
         case 'facet_dates':
             if (isset($this->ResultArray['facet_dates'])) {
                 return $this->ResultArray['facet_dates'];
             } else {
                 return false;
             }
             break;
         case 'facet_ranges':
             if (isset($this->ResultArray['facet_counts']['facet_ranges'])) {
                 return $this->ResultArray['facet_counts']['facet_ranges'];
             } else {
                 return false;
             }
             break;
         case 'clusters':
             if (isset($this->ResultArray['clusters'])) {
                 return $this->ResultArray['clusters'];
             } else {
                 return false;
             }
             break;
         default:
             break;
     }
     return null;
 }
開發者ID:heliopsis,項目名稱:ezfind,代碼行數:101,代碼來源:ezfsearchresultinfo.php


注:本文中的eZSolr::engineText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。