本文整理汇总了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;
}