MCPcopy Create free account
hub / github.com/apache/solr / getQuery

Method getQuery

solr/core/src/java/org/apache/solr/search/QParser.java:195–224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)) {

Callers 15

parseQueryMethod · 0.95
XtestRangePerformanceMethod · 0.95
testMatchAllDocsMethod · 0.95
testSowFalseWithBoostMethod · 0.95
testShingleQueriesMethod · 0.95
testBandsWrapMethod · 0.95
testCSQMethod · 0.95
testAutoTermsMethod · 0.95

Calls 8

parseMethod · 0.95
extendedQueryMethod · 0.95
isBlankMethod · 0.80
getMethod · 0.65
setCacheMethod · 0.65
setCostMethod · 0.65
equalsMethod · 0.45
getIntMethod · 0.45

Tested by 15

parseQueryMethod · 0.76
XtestRangePerformanceMethod · 0.76
testMatchAllDocsMethod · 0.76
testSowFalseWithBoostMethod · 0.76
testShingleQueriesMethod · 0.76
testBandsWrapMethod · 0.76
testCSQMethod · 0.76
testAutoTermsMethod · 0.76