当前位置: 首页>>代码示例>>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;未经允许,请勿转载。