本文整理汇总了PHP中Tx_Solr_Util::getPageDocumentId方法的典型用法代码示例。如果您正苦于以下问题:PHP Tx_Solr_Util::getPageDocumentId方法的具体用法?PHP Tx_Solr_Util::getPageDocumentId怎么用?PHP Tx_Solr_Util::getPageDocumentId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tx_Solr_Util
的用法示例。
在下文中一共展示了Tx_Solr_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 = Tx_Solr_Site::getSiteByPageId($this->page->id);
$pageRecord = $this->page->page;
self::$pageSolrDocumentId = $documentId = Tx_Solr_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;
}