Permalink
Browse files

Normalize basename before indexation if needed (macos)

  • Loading branch information...
1 parent de3c78d commit e6e72b95316ae01a6673c1b322dddc71fe19e5b5 @cdujeu cdujeu committed Oct 11, 2016
Showing with 5 additions and 1 deletion.
  1. +5 −1 core/src/plugins/index.lucene/LuceneIndexer.php
@@ -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)));

0 comments on commit e6e72b9

Please sign in to comment.