Changeset 28459
- Timestamp:
- May 13, 2014, 10:09:04 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager.php
r28318 r28459 395 395 { 396 396 include_once( PHPWG_ROOT_PATH .'include/functions_search.inc.php' ); 397 $res = get_quick_search_results ($_SESSION['bulk_manager_filter']['search']['q'], array('permissions'=>false));397 $res = get_quick_search_results_no_cache($_SESSION['bulk_manager_filter']['search']['q'], array('permissions'=>false)); 398 398 $filter_sets[] = $res['items']; 399 399 } -
trunk/include/functions_search.inc.php
r28383 r28459 266 266 define('QST_BREAK', 0x20); 267 267 268 /** 269 * A search scope applies to a single token and restricts the search to a subset of searchable fields. 270 */ 268 271 class QSearchScope 269 272 { … … 604 607 break; 605 608 } 606 if (strlen($crt_token) && isdigit(substr($crt_token,0,-1))607 && $qi+1<strlen($q) && isdigit($q[$qi+1]))609 if (strlen($crt_token) && preg_match('/[0-9]/', substr($crt_token,-1)) 610 && $qi+1<strlen($q) && preg_match('/[0-9]/', $q[$qi+1])) 608 611 {// dot between digits is not a separator e.g. F2.8 609 612 $crt_token .= $ch; … … 704 707 } 705 708 709 /** 710 * Applies recursively a search scope to all sub single tokens. We allow 'tag:(John Bill)' but we cannot evaluate 711 * scopes on expressions so we rewrite as '(tag:John tag:Bill)' 712 */ 706 713 private function apply_scope(QSearchScope $scope) 707 714 { … … 1062 1069 } 1063 1070 1071 1064 1072 /** 1065 1073 * Returns the search results corresponding to a quick/query search. … … 1083 1091 function get_quick_search_results($q, $options) 1084 1092 { 1093 global $persistent_cache, $conf, $user; 1094 1095 $cache_key = $persistent_cache->make_key( array( 1096 strtolower($q), 1097 $conf['order_by'], 1098 $user['id'],$user['cache_update_time'], 1099 isset($options['permissions']) ? (boolean)$options['permissions'] : true, 1100 isset($options['images_where']) ? $options['images_where'] : '', 1101 ) ); 1102 if ($persistent_cache->get($cache_key, $res)) 1103 { 1104 return $res; 1105 } 1106 1107 $res = get_quick_search_results_no_cache($q, $options); 1108 1109 $persistent_cache->set($cache_key, $res, 300); 1110 return $res; 1111 } 1112 1113 /** 1114 * @see get_quick_search_results but without result caching 1115 */ 1116 function get_quick_search_results_no_cache($q, $options) 1117 { 1085 1118 global $conf; 1086 1119 //@TODO: maybe cache for 10 minutes the result set to avoid many expensive sql calls when navigating the pictures
Note: See TracChangeset
for help on using the changeset viewer.