mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Add triggers to support alternative implementations of document search
게시판 검색시 문서 목록을 캐싱하거나, ElasticSearch 등 별도의 검색엔진을 활용할 수 있도록 document.getDocumentList에서 트리거를 제공합니다. 이 커밋만으로 기능에 변화가 있는 것은 아니고, 추후 검색 기능을 개선할 수 있도록 기반을 닦는 의미입니다.
This commit is contained in:
parent
669a5cedac
commit
72fa81dc41
1 changed files with 18 additions and 2 deletions
|
|
@ -222,9 +222,24 @@ class documentModel extends document
|
|||
$obj->sort_index = $sort_check->sort_index;
|
||||
$obj->isExtraVars = $sort_check->isExtraVars;
|
||||
|
||||
$this->_setSearchOption($obj, $args, $query_id, $use_division);
|
||||
$output = ModuleHandler::triggerCall('document.getDocumentList', 'before', $obj);
|
||||
if($output instanceof Object && !$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
if ($sort_check->isExtraVars && substr_count($obj->search_target,'extra_vars'))
|
||||
$use_alternative_list = (isset($GLOBALS['XE_DOCUMENT_ALTERNATIVE_LIST']) && $GLOBALS['XE_DOCUMENT_ALTERNATIVE_LIST'] instanceof Object);
|
||||
if (!$use_alternative_list)
|
||||
{
|
||||
$this->_setSearchOption($obj, $args, $query_id, $use_division);
|
||||
}
|
||||
|
||||
if ($use_alternative_list)
|
||||
{
|
||||
$output = $GLOBALS['XE_DOCUMENT_ALTERNATIVE_LIST'];
|
||||
unset($GLOBALS['XE_DOCUMENT_ALTERNATIVE_LIST']);
|
||||
}
|
||||
elseif ($sort_check->isExtraVars && substr_count($obj->search_target,'extra_vars'))
|
||||
{
|
||||
$query_id = 'document.getDocumentListWithinExtraVarsExtraSort';
|
||||
$args->sort_index = str_replace('documents.','',$args->sort_index);
|
||||
|
|
@ -319,6 +334,7 @@ class documentModel extends document
|
|||
}
|
||||
}
|
||||
|
||||
ModuleHandler::triggerCall('document.getDocumentList', 'after', $obj);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue