Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 8ee9ad7

Browse files
committed
Fix meta fields indexation issues (on node.change event).
1 parent c91ad01 commit 8ee9ad7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

core/src/core/classes/class.AJXP_Node.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ class AJXP_Node
5252
* @var bool Whether the core information of the node is already loaded or not
5353
*/
5454
protected $nodeInfoLoaded = false;
55+
/**
56+
* @var string Details level passed to nodeLoadInfo()
57+
*/
58+
protected $nodeInfoLevel = "minimal";
5559
/**
5660
* @var Repository
5761
*/
@@ -386,6 +390,9 @@ public function listMetaKeys()
386390
*/
387391
public function loadNodeInfo($forceRefresh = false, $contextNode = false, $details = false)
388392
{
393+
if($this->nodeInfoLoaded && $this->nodeInfoLevel != $details){
394+
$forceRefresh = true;
395+
}
389396
if($this->nodeInfoLoaded && !$forceRefresh) return;
390397
if (!empty($this->_wrapperClassName)) {
391398
$registered = AJXP_PluginsService::getInstance()->getRegisteredWrappers();
@@ -396,6 +403,7 @@ public function loadNodeInfo($forceRefresh = false, $contextNode = false, $detai
396403
}
397404
AJXP_Controller::applyHook("node.info", array(&$this, $contextNode, $details));
398405
$this->nodeInfoLoaded = true;
406+
$this->nodeInfoLevel = $details;
399407
}
400408

401409
/**

core/src/plugins/index.lucene/class.AjxpLuceneIndexer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,11 @@ public function updateNodeIndex($oldNode, $newNode = null, $copy = false, $recur
527527
*/
528528
public function createIndexedDocument($ajxpNode, &$index)
529529
{
530-
$ajxpNode->loadNodeInfo();
530+
if(!empty($this->metaFields)){
531+
$ajxpNode->loadNodeInfo(false, false, "all");
532+
}else{
533+
$ajxpNode->loadNodeInfo();
534+
}
531535
$ext = strtolower(pathinfo($ajxpNode->getLabel(), PATHINFO_EXTENSION));
532536
$parseContent = $this->indexContent;
533537
if ($parseContent && $ajxpNode->bytesize > $this->getFilteredOption("PARSE_CONTENT_MAX_SIZE")) {

0 commit comments

Comments
 (0)