1 package org.apache.lucene.queryParser.ext;
3 import org.apache.lucene.queryParser.QueryParser;
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * {@link ExtensionQuery} holds all query components extracted from the original
24 * query string like the query field and the extension query string.
27 * @see ExtendableQueryParser
28 * @see ParserExtension
30 public class ExtensionQuery {
32 private final String field;
33 private final String rawQueryString;
34 private final QueryParser topLevelParser;
37 * Creates a new {@link ExtensionQuery}
41 * @param rawQueryString
42 * the raw extension query string
44 public ExtensionQuery(QueryParser topLevelParser, String field, String rawQueryString) {
46 this.rawQueryString = rawQueryString;
47 this.topLevelParser = topLevelParser;
51 * Returns the query field
53 * @return the query field
55 public String getField() {
60 * Returns the raw extension query string
62 * @return the raw extension query string
64 public String getRawQueryString() {
65 return rawQueryString;
69 * Returns the top level parser which created this {@link ExtensionQuery}
70 * @return the top level parser which created this {@link ExtensionQuery}
72 public QueryParser getTopLevelParser() {
73 return topLevelParser;