Commit 4561b0c8 authored by nkoth's avatar nkoth

[ENH] Many files when uploaded has underscore in filenames which makes search...

[ENH] Many files when uploaded has underscore in filenames which makes search difficult, e.g. a file like Test_Ultrasonic.zip will not match Ultrasonic otherwise. Therefore replace underscores with spaces for "name" (note not "filename") when indexing
parent fa8693a8
......@@ -45,6 +45,11 @@ class Search_ContentSource_FileSource implements Search_ContentSource_Interface,
return false;
}
if (!empty($file['name'])) {
// Many files when uploaded have underscore in the file name and makes search difficult
$file['name'] = str_replace('_', ' ', $file['name']);
}
$data = array(
'title' => $typeFactory->sortable(empty($file['name'])?$file['filename']:$file['name']),
'language' => $typeFactory->identifier('unknown'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment