1 package org.apache.lucene.queryParser.standard.nodes;
3 import org.apache.lucene.queryParser.core.nodes.FieldQueryNode;
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 * A {@link PrefixWildcardQueryNode} represents wildcardquery that matches abc*
24 * or *. This does not apply to phrases, this is a special case on the original
25 * lucene parser. TODO: refactor the code to remove this special case from the
26 * parser. and probably do it on a Processor
28 public class PrefixWildcardQueryNode extends WildcardQueryNode {
30 private static final long serialVersionUID = 6851557641826407515L;
36 * - value including the wildcard
38 * - position in the query string
40 * - position in the query string
42 public PrefixWildcardQueryNode(CharSequence field, CharSequence text,
44 super(field, text, begin, end);
47 public PrefixWildcardQueryNode(FieldQueryNode fqn) {
48 this(fqn.getField(), fqn.getText(), fqn.getBegin(), fqn.getEnd());
52 public String toString() {
53 return "<prefixWildcard field='" + this.field + "' term='" + this.text
58 public PrefixWildcardQueryNode cloneTree() throws CloneNotSupportedException {
59 PrefixWildcardQueryNode clone = (PrefixWildcardQueryNode) super.cloneTree();