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

Commit

Permalink
Normalize basename before indexation if needed (macos)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 11, 2016
1 parent de3c78d commit e6e72b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/plugins/index.lucene/LuceneIndexer.php
Expand Up @@ -628,7 +628,11 @@ public function createIndexedDocument($ajxpNode, &$index)

$doc->addField(\Zend_Search_Lucene_Field::keyword("node_url", $ajxpNode->getUrl(), "UTF-8"));
$doc->addField(\Zend_Search_Lucene_Field::keyword("node_path", str_replace("/", "AJXPFAKESEP", $ajxpNode->getPath()), "UTF-8"));
$doc->addField(\Zend_Search_Lucene_Field::text("basename", basename($ajxpNode->getPath()), "UTF-8"));
$basename = basename($ajxpNode->getPath());
if(class_exists("Normalizer") && !\Normalizer::isNormalized($basename, \Normalizer::FORM_C)){
$basename = \Normalizer::normalize($basename, \Normalizer::FORM_C);
}
$doc->addField(\Zend_Search_Lucene_Field::text("basename", $basename, "UTF-8"));
$doc->addField(\Zend_Search_Lucene_Field::keyword("ajxp_node", "yes"));
$doc->addField(\Zend_Search_Lucene_Field::keyword("ajxp_scope", "shared"));
$doc->addField(\Zend_Search_Lucene_Field::keyword("ajxp_modiftime", date("Ymd", $ajxpNode->ajxp_modiftime)));
Expand Down

0 comments on commit e6e72b9

Please sign in to comment.