Lines Matching +full:- +full:q

34                 $parsed .= $this->termParser($word, false, $phrase_mode);
73 * -exclude
76 * -"phrase you want to exclude"
79 * ^exclude:namespace (or -ns:exclude:namespace)
82 * -()
89 * this query is equivalent to [ -(-aa or -"bb cc" or -ns:dd:ee) ]
94 * ( ) - group
95 * AND - logical and
96 * OR - logical or
97 * NOT - logical not
98 * W+:, W-:, W_: - word (underscore: no need to highlight)
99 * P+:, P-: - phrase (minus sign: logically in NOT group)
100 * N+:, N-: - namespace
105 '/(-?".*?")/u',
107 -1,
113 if (preg_match('/^(-?)"(.+)"$/u', $term, $matches)) {
114 // phrase-include and phrase-exclude
116 $parsed = $not . $this->termParser($matches[2], false, true);
124 $term = str_replace('- (', ' -(', $term);
138 // parenthesis-include-open
141 } elseif ($token === '-(') {
142 // parenthesis-exclude-open
146 // parenthesis-any-close
149 $parens_level--;
151 // logical-and (do nothing)
153 // logical-or
155 } elseif (preg_match('/^(?:\^|-ns:)(.+)$/u', $token, $matches)) {
156 // namespace-exclude
159 // namespace-include
161 } elseif (preg_match('/^-(.+)$/', $token, $matches)) {
162 // word-exclude
163 $parsed .= 'NOT(' . $this->termParser($matches[1]) . ')';
165 // word-include
166 $parsed .= $this->termParser($token);
192 -1,
201 if ($parens_level-- === end($notgrp_levels)) array_pop($notgrp_levels);
203 // turn highlight-flag off if terms are logically in "NOT" group
204 $token = preg_replace('/([WPN])\+\:/u', '$1-:', $token);
212 * by Shunting-yard algorithm
215 * see: http://en.wikipedia.org/wiki/Shunting-yard_algorithm
225 -1,
256 if ($parsed_ary[$i] === 'NOT' && $parsed_ary[$i - 1] === 'NOT') {
257 unset($parsed_ary[$i], $parsed_ary[$i - 1]);
263 $q = [];
264 $q['query'] = $query;
265 $q['parsed_str'] = $parsed_query;
266 $q['parsed_ary'] = $parsed_ary;
268 foreach ($q['parsed_ary'] as $token) {
274 $q['ns'][] = $body; // for backward compatibility
276 case 'N-:':
277 $q['notns'][] = $body; // for backward compatibility
280 $q['words'][] = $body;
282 case 'W-:':
283 $q['words'][] = $body;
284 $q['not'][] = $body; // for backward compatibility
287 $q['words'][] = $body;
288 $q['highlight'][] = $body;
289 $q['and'][] = $body; // for backward compatibility
291 case 'P-:':
292 $q['phrases'][] = $body;
295 $q['phrases'][] = $body;
296 $q['highlight'][] = $body;
301 $q[$key] = empty($q[$key]) ? [] : array_values(array_unique($q[$key]));
304 return $q;
324 $query .= ' -' . implode(' -', $not);