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

Commit e6e72b9

Browse files
committed
Normalize basename before indexation if needed (macos)
1 parent de3c78d commit e6e72b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/plugins/index.lucene/LuceneIndexer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,11 @@ public function createIndexedDocument($ajxpNode, &$index)
628628

629629
$doc->addField(\Zend_Search_Lucene_Field::keyword("node_url", $ajxpNode->getUrl(), "UTF-8"));
630630
$doc->addField(\Zend_Search_Lucene_Field::keyword("node_path", str_replace("/", "AJXPFAKESEP", $ajxpNode->getPath()), "UTF-8"));
631-
$doc->addField(\Zend_Search_Lucene_Field::text("basename", basename($ajxpNode->getPath()), "UTF-8"));
631+
$basename = basename($ajxpNode->getPath());
632+
if(class_exists("Normalizer") && !\Normalizer::isNormalized($basename, \Normalizer::FORM_C)){
633+
$basename = \Normalizer::normalize($basename, \Normalizer::FORM_C);
634+
}
635+
$doc->addField(\Zend_Search_Lucene_Field::text("basename", $basename, "UTF-8"));
632636
$doc->addField(\Zend_Search_Lucene_Field::keyword("ajxp_node", "yes"));
633637
$doc->addField(\Zend_Search_Lucene_Field::keyword("ajxp_scope", "shared"));
634638
$doc->addField(\Zend_Search_Lucene_Field::keyword("ajxp_modiftime", date("Ymd", $ajxpNode->ajxp_modiftime)));

0 commit comments

Comments
 (0)