本文整理匯總了PHP中ApacheSolrForTypo3\Solr\Util::getPageDocumentId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Util::getPageDocumentId方法的具體用法?PHP Util::getPageDocumentId怎麽用?PHP Util::getPageDocumentId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ApacheSolrForTypo3\Solr\Util
的用法示例。
在下文中一共展示了Util::getPageDocumentId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getPageDocument
/**
* Builds the Solr document for the current page.
*
* @return \Apache_Solr_Document A document representing the page
*/
protected function getPageDocument()
{
$document = GeneralUtility::makeInstance('\\Apache_Solr_Document');
/* @var $document \Apache_Solr_Document */
$site = Site::getSiteByPageId($this->page->id);
$pageRecord = $this->page->page;
self::$pageSolrDocumentId = $documentId = Util::getPageDocumentId($this->page->id, $this->page->type, $this->page->sys_language_uid, $this->getDocumentIdGroups());
$document->setField('id', $documentId);
$document->setField('site', $site->getDomain());
$document->setField('siteHash', $site->getSiteHash());
$document->setField('appKey', 'EXT:solr');
$document->setField('type', 'pages');
// system fields
$document->setField('uid', $this->page->id);
$document->setField('pid', $pageRecord['pid']);
$document->setField('typeNum', $this->page->type);
$document->setField('created', $pageRecord['crdate']);
$document->setField('changed', $pageRecord['tstamp']);
$document->setField('rootline', $this->page->id);
// access
$document->setField('access', (string) $this->pageAccessRootline);
if ($this->page->page['endtime']) {
$document->setField('endtime', $pageRecord['endtime']);
}
// content
$document->setField('title', $this->contentExtractor->getPageTitle());
$document->setField('subTitle', $pageRecord['subtitle']);
$document->setField('navTitle', $pageRecord['nav_title']);
$document->setField('author', $pageRecord['author']);
$document->setField('description', $pageRecord['description']);
$document->setField('abstract', $pageRecord['abstract']);
$document->setField('content', $this->contentExtractor->getIndexableContent());
$document->setField('url', $this->pageUrl);
// keywords, multi valued
$keywords = array_unique(GeneralUtility::trimExplode(',', $pageRecord['keywords'], TRUE));
foreach ($keywords as $keyword) {
$document->addField('keywords', $keyword);
}
// content from several tags like headers, anchors, ...
$tagContent = $this->contentExtractor->getTagContent();
foreach ($tagContent as $fieldName => $fieldValue) {
$document->setField($fieldName, $fieldValue);
}
return $document;
}