1 /* ====================================================================
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 * ====================================================================
16 package org.apache.pylucene.queryParser;
18 import java.util.List;
20 import org.apache.lucene.analysis.Analyzer;
21 import org.apache.lucene.search.Query;
22 import org.apache.lucene.queryParser.QueryParser;
23 import org.apache.lucene.queryParser.CharStream;
24 import org.apache.lucene.queryParser.ParseException;
25 import org.apache.lucene.util.Version;
28 public class PythonQueryParser extends QueryParser {
30 private long pythonObject;
32 public PythonQueryParser(Version version, String field, Analyzer analyzer)
34 super(version, field, analyzer);
37 public PythonQueryParser(CharStream stream)
42 public void pythonExtension(long pythonObject)
44 this.pythonObject = pythonObject;
46 public long pythonExtension()
48 return this.pythonObject;
51 public void finalize()
57 public native void pythonDecRef();
58 public native Query getBooleanQuery(List clauses, boolean disableCoord);
59 public native Query getFuzzyQuery(String field, String termText,
61 public native Query getPrefixQuery(String field, String termText);
62 public native Query getRangeQuery(String field,
63 String part1, String part2,
65 public native Query getWildcardQuery(String field, String termText);
67 public native Query getFieldQuery_quoted(String field, String queryText,
69 public native Query getFieldQuery_slop(String field, String queryText,
72 public Query getFieldQuery_quoted_super(String field, String queryText,
76 return super.getFieldQuery(field, queryText, quoted);
79 public Query getFieldQuery_slop_super(String field, String queryText,
83 return super.getFieldQuery(field, queryText, slop);
86 public Query getFieldQuery(String field, String queryText, boolean quoted)
88 return getFieldQuery_quoted(field, queryText, quoted);
91 public Query getFieldQuery(String field, String queryText, int slop)
93 return getFieldQuery_slop(field, queryText, slop);