diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-01-31 16:12:49 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-01-31 16:12:49 +0100 |
commit | c46f701771db9285e70a5b1d5a4b641046bf703c (patch) | |
tree | 2c020015d04ede4be9f158d48a36c1eb158c0e72 /lib/search | |
parent | df67c35017d8794a4b1c83fd4e41658b2e6d0e75 (diff) | |
download | nextcloud-server-c46f701771db9285e70a5b1d5a4b641046bf703c.tar.gz nextcloud-server-c46f701771db9285e70a5b1d5a4b641046bf703c.zip |
use filesystem cache for searching
Diffstat (limited to 'lib/search')
-rw-r--r-- | lib/search/provider/file.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/search/provider/file.php b/lib/search/provider/file.php index 5fd35fa3e52..c3dc2942aef 100644 --- a/lib/search/provider/file.php +++ b/lib/search/provider/file.php @@ -2,14 +2,15 @@ class OC_Search_Provider_File extends OC_Search_Provider{ function search($query){ - $files=OC_Filesystem::search($query); + $files=OC_FileCache::search($query,true); $results=array(); - foreach($files as $file){ - if(OC_Filesystem::is_dir($file)){ + foreach($files as $fileData){ + $file=$fileData['path']; + if($fileData['mime']=='httpd/unix-directory'){ $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'index.php?dir='.$file ),'Files'); }else{ - $mime=OC_Filesystem::getMimeType($file); - $mimeBase=substr($mime,0,strpos($mime,'/')); + $mime=$fileData['mime']; + $mimeBase=$fileData['mimepart']; switch($mimeBase){ case 'audio': break; |