Changeset 28092
- Timestamp:
- Apr 6, 2014, 8:33:46 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 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']); -
trunk/language/en_UK/help/quick_search.html
r28087 r28092 35 35 <q>OR search</q><br> 36 36 </td> 37 <td>Add a OR between words.<br>37 <td>Add an OR between words.<br> 38 38 <q>john OR bill</q></td> 39 39 </tr> … … 64 64 65 65 <tr> 66 <td><q>tag:</q> 66 <td><q>tag:</q><br> 67 <q>tags:</q> 67 68 </td> 68 69 <td>Searches only in tag names without looking at photo titles or descriptions.<br> … … 71 72 72 73 <tr> 73 <td><q>photo:</q> 74 <td><q>photo:</q><br> 75 <q>photos:</q> 74 76 </td> 75 <td></td> 77 <td>Searches only for photos with the given words in title or description.<br> 78 <q>photo:John</q></td> 76 79 </tr> 77 80 … … 79 82 <td><q>file:</q> 80 83 </td> 81 <td>Searches by file name.</td> 84 <td>Searches by file name.<br> 85 <q>file:DSC_</q></td> 82 86 </tr> 83 87 … … 85 89 <td><q>created:</q><br> 86 90 <q>taken:</q> 91 <q>shot:</q> 87 92 </td> 88 <td>Searches photos by taken date <br>93 <td>Searches photos by taken date.<br> 89 94 <q>taken:2003</q> photos taken in 2003<br> 90 95 <q>taken:20035</q>,<q>taken:2003-5</q>,<q>taken:2003-05</q> photos from may 2003<br> … … 97 102 <td><q>posted:</q> 98 103 </td> 99 <td> </td>104 <td>Searches photos by posted date.</td> 100 105 </tr> 101 106 … … 104 109 <q>height:</q> 105 110 </td> 106 <td> </td>111 <td>Searches photos with a given width or height.</td> 107 112 </tr> 108 113 <tr> 109 114 <td><q>size:</q> 110 115 </td> 111 <td></td> 116 <td>Searches photos by size in pixels<br> 117 <q>size:5m</q> returns photos of 5 megapixels<br> 118 <q>size:>12m</q> returns photos of 12 megapixels or more<br></td> 112 119 </tr> 113 120 <tr> 114 121 <td><q>ratio:</q> 115 122 </td> 116 <td></td> 123 <td>Searches photos by width/height ratio.<br> 124 <q>ratio:3/4 OR ratio:4/3</q> finds photos from compact cameras in portrait or landscape modes 125 <q>ratio:>16/9</q> finds panoramas 126 </td> 117 127 </tr> 118 128 <tr> … … 122 132 </tr> 123 133 <tr> 124 <td><q>score:</q> 134 <td><q>score:</q><br> 135 <q>rating:</q> 125 136 </td> 126 <td></td> 137 <td>Hint: <q>score:*</q> will give you all photos with at least one vote. <q>score:</q> will give you photos without votes.</td> 138 </tr> 139 <tr> 140 <td><q>filesize:</q> 141 </td> 142 <td>Searches photos by file size<br> 143 <q>filesize:1m..10m</q> finds files between 1MB and 10MB.</td> 127 144 </tr> 128 145
Note: See TracChangeset
for help on using the changeset viewer.