Changeset 28092 for trunk/include/functions_search.inc.php
- Timestamp:
- Apr 6, 2014, 8:33:46 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_search.inc.php
r28090 r28092 868 868 $clauses[] = $file_like; 869 869 870 if ($inflector!=null && strlen($term)>2 870 $variants = array(); 871 if (strlen($term)>2 871 872 && ($expr->stoken_modifiers[$i] & (QST_QUOTED|QST_WILDCARD))==0 872 && strcspn($term, '\'0123456789') == strlen($term) 873 ) 874 { 875 $variants = array_unique( array_diff( $inflector->get_variants($term), array($term) ) ); 873 && strcspn($term, '\'0123456789') == strlen($term) ) 874 { 875 if ($inflector!=null) 876 $variants = array_unique( array_diff( $inflector->get_variants($term), array($term) ) ); 877 $variants = trigger_event('qsearch_get_variants', $variants, $token, $expr); 878 $variants = array_unique( array_diff( $variants, array($term) ) ); 876 879 $qsr->variants[$term] = $variants; 877 }878 else879 {880 $variants = array();881 880 } 882 881 … … 931 930 $clauses[] = $token->scope->get_sql('date_available', $token); 932 931 break; 933 932 default: 933 // allow plugins to have their own scope with columns added in db by themselves 934 $clauses = trigger_event('qsearch_get_images_sql_scopes', $clauses, $token, $expr); 935 break; 934 936 } 935 937 if (!empty($clauses)) … … 1217 1219 $scopes[] = new QNumericRangeScope('score', array('rating'), true); 1218 1220 1219 $createdDateAliases = array('taken' );1221 $createdDateAliases = array('taken', 'shot'); 1220 1222 $postedDateAliases = array('added'); 1221 1223 if ($conf['calendar_datefield'] == 'date_creation') … … 1226 1228 $scopes[] = new QDateRangeScope('posted', $postedDateAliases); 1227 1229 1230 // allow plugins to add their own scopes 1231 $scopes = trigger_event('qsearch_get_scopes', $scopes); 1228 1232 $expression = new QExpression($q, $scopes); 1233 trigger_action('qsearch_expression_parsed', $expression); 1229 1234 //var_export($expression); 1230 1235 1236 if (count($expression->stokens)==0) 1237 { 1238 return $search_results; 1239 } 1231 1240 $qsr = new QResults; 1232 1241 qsearch_get_tags($expression, $qsr); 1233 1242 qsearch_get_images($expression, $qsr); 1234 //var_export($qsr->all_tags); 1243 1244 // allow plugins to evaluate their own scopes 1245 trigger_action('qsearch_before_eval', $expression, $qsr); 1235 1246 1236 1247 $ids = qsearch_eval($expression, $qsr, $tmp, $search_results['qs']['unmatched_terms']);
Note: See TracChangeset
for help on using the changeset viewer.