| 193 | } |
| 194 | |
| 195 | public void setString(String s) { |
| 196 | this.qstr = s; |
| 197 | } |
| 198 | |
| 199 | public boolean isAutoFixPureNegative() { |
| 200 | return autoFixPureNegative; |
| 201 | } |
| 202 | |
| 203 | public void setAutoFixPureNegative(boolean autoFixPureNegative) { |
| 204 | this.autoFixPureNegative = autoFixPureNegative; |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * Returns the resulting query from this QParser, calling parse() only the first time and caching |
| 209 | * the Query result. <em>A null return is possible!</em> |
| 210 | */ |
| 211 | // TODO never return null; standardize the semantics |
| 212 | public Query getQuery() throws SyntaxError { |
| 213 | if (query == null) { |
| 214 | query = parse(); |
| 215 | |
| 216 | if (localParams != null) { |
| 217 | // MUST come before extendedQuery() calls below: NamedMatches is not an ExtendedQuery, |
| 218 | // so wrapping must happen first so that extendedQuery() can wrap it in a WrappedQuery |
| 219 | // that preserves the cache/cost settings as the outermost layer. |
| 220 | String name = localParams.get(QueryParsing.NAME); |
| 221 | if (name != null && !name.isBlank() && query != null) { |
| 222 | query = NamedMatches.wrapQuery(name, query); |
| 223 | } |
| 224 | |
| 225 | String cacheStr = localParams.get(CommonParams.CACHE); |
| 226 | if (cacheStr != null) { |
| 227 | if (CommonParams.FALSE.equals(cacheStr)) { |