/* Generated By:JavaCC: Do not edit this line. QueryParser.java */
/**
* This class is generated by JavaCC. The most important method is
* {@link #parse(String)}.
*
* The syntax for query strings is as follows:
* A Query is a series of clauses.
* A clause may be prefixed by:
* <ul>
* <li> a plus (<code>+</code>) or a minus (<code>-</code>) sign, indicating
* that the clause is required or prohibited respectively; or
* <li> a term followed by a colon, indicating the field to be searched.
* This enables one to construct queries which search multiple fields.
* </ul>
*
* A clause may be either:
* <ul>
* <li> a term, indicating all the documents that contain this term; or
* <li> a nested query, enclosed in parentheses. Note that this may be used
* with a <code>+</code>/<code>-</code> prefix to require any of a set of
* terms.
* </ul>
*
* Thus, in BNF, the query grammar is:
* <pre>
* Query ::= ( Clause )*
* Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" )
* </pre>
*
* <p>
* Examples of appropriately formatted queries can be found in the <a
* href="../../../../../../queryparsersyntax.html">query syntax
* documentation</a>.
* </p>
*
* <p>
* In {@link TermRangeQuery}s, QueryParser tries to detect date values, e.g.
* <tt>date:[6/1/2005 TO 6/4/2005]</tt> produces a range query that searches
* for "date" fields between 2005-06-01 and 2005-06-04. Note that the format
* of the accepted input depends on {@link #setLocale(Locale) the locale}.
* By default a date is converted into a search term using the deprecated
* {@link DateField} for compatibility reasons.
* To use the new {@link DateTools} to convert dates, a
* {@link org.apache.lucene.document.DateTools.Resolution} has to be set.
* </p>
* <p>
* The date resolution that shall be used for RangeQueries can be set
* using {@link #setDateResolution(DateTools.Resolution)}
* or {@link #setDateResolution(String, DateTools.Resolution)}. The former
* sets the default date resolution for all fields, whereas the latter can
* be used to set field specific date resolutions. Field specific date
* resolutions take, if set, precedence over the default date resolution.
* </p>
* <p>
* If you use neither {@link DateField} nor {@link DateTools} in your
* index, you can create your own
* query parser that inherits QueryParser and overwrites
* {@link #getRangeQuery(String, String, String, boolean)} to
* use a different method for date conversion.
* </p>
*
* <p>Note that QueryParser is <em>not</em> thread-safe.</p>
*
* <p><b>NOTE</b>: there is a new QueryParser in contrib, which matches
* the same syntax as this class, but is more modular,
* enabling substantial customization to how a query is created.
*
* <a name="version"/>
* <p><b>NOTE</b>: You must specify the required {@link Version}
* compatibility when creating QueryParser:
* <ul>
* <li> As of 2.9, {@link #setEnablePositionIncrements} is true by
* default.
* <li> As of 3.1, {@link #setAutoGeneratePhraseQueries} is false by
* default.
* </ul>
*/
// make it possible to call setDefaultOperator() without accessing
// the nested class:
/** Alternative form of QueryParser.Operator.AND */
/** Alternative form of QueryParser.Operator.OR */
/** The actual operator that parser uses to combine query terms */
boolean lowercaseExpandedTerms = true;
MultiTermQuery.RewriteMethod multiTermRewriteMethod = MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT;
boolean allowLeadingWildcard = false;
boolean enablePositionIncrements = true;
// the default date resolution
// maps field names to date resolutions
// The collator to use when determining range inclusion,
// for use when constructing RangeQuerys.
/** @deprecated remove when getFieldQuery is removed */
/** @deprecated remove when getFieldQuery is removed */
new VirtualMethod<QueryParser>(QueryParser.class, "getFieldQuery", String.class, String.class, boolean.class);
/** @deprecated remove when getFieldQuery is removed */
private final boolean hasNewAPI =
private boolean autoGeneratePhraseQueries;
/** The default operator for parsing queries.
* Use {@link QueryParser#setDefaultOperator} to change it.
*/
/** Constructs a query parser.
* @param matchVersion Lucene version to match. See <a href="#version">above</a>.
* @param f the default field for query terms.
* @param a used to find terms in the query text.
*/
analyzer = a;
field = f;
enablePositionIncrements = true;
} else {
enablePositionIncrements = false;
}
setAutoGeneratePhraseQueries(false);
} else {
setAutoGeneratePhraseQueries(true);
}
}
/** Parses a query string, returning a {@link org.apache.lucene.search.Query}.
* @param query the query string to be parsed.
* @throws ParseException if the parsing fails
*/
try {
// TopLevelQuery is a Query followed by the end-of-input (EOF)
}
catch (ParseException tme) {
// rethrow to include the original query:
throw e;
}
catch (TokenMgrError tme) {
throw e;
}
throw e;
}
}
/**
* @return Returns the analyzer.
*/
return analyzer;
}
/**
* @return Returns the field.
*/
return field;
}
/**
* @see #setAutoGeneratePhraseQueries(boolean)
*/
public final boolean getAutoGeneratePhraseQueries() {
return autoGeneratePhraseQueries;
}
/**
* Set to true if phrase queries will be automatically generated
* when the analyzer returns more than one term from whitespace
* delimited text.
* NOTE: this behavior may not be suitable for all languages.
* <p>
* Set to false if phrase queries should only be generated when
* surrounded by double quotes.
*/
throw new IllegalArgumentException("You must implement the new API: getFieldQuery(String,String,boolean)"
+ " to use setAutoGeneratePhraseQueries(false)");
this.autoGeneratePhraseQueries = value;
}
/**
* Get the minimal similarity for fuzzy queries.
*/
public float getFuzzyMinSim() {
return fuzzyMinSim;
}
/**
* Set the minimum similarity for fuzzy queries.
* Default is 0.5f.
*/
this.fuzzyMinSim = fuzzyMinSim;
}
/**
* Get the prefix length for fuzzy queries.
* @return Returns the fuzzyPrefixLength.
*/
public int getFuzzyPrefixLength() {
return fuzzyPrefixLength;
}
/**
* Set the prefix length for fuzzy queries. Default is 0.
* @param fuzzyPrefixLength The fuzzyPrefixLength to set.
*/
this.fuzzyPrefixLength = fuzzyPrefixLength;
}
/**
* Sets the default slop for phrases. If zero, then exact phrase matches
* are required. Default value is zero.
*/
this.phraseSlop = phraseSlop;
}
/**
* Gets the default slop for phrases.
*/
public int getPhraseSlop() {
return phraseSlop;
}
/**
* Set to <code>true</code> to allow leading wildcard characters.
* <p>
* When set, <code>*</code> or <code>?</code> are allowed as
* the first character of a PrefixQuery and WildcardQuery.
* Note that this can produce very slow
* queries on big indexes.
* <p>
* Default: false.
*/
}
/**
* @see #setAllowLeadingWildcard(boolean)
*/
public boolean getAllowLeadingWildcard() {
return allowLeadingWildcard;
}
/**
* Set to <code>true</code> to enable position increments in result query.
* <p>
* When set, result phrase and multi-phrase queries will
* be aware of position increments.
* Useful when e.g. a StopFilter increases the position increment of
* the token that follows an omitted token.
* <p>
* Default: false.
*/
this.enablePositionIncrements = enable;
}
/**
* @see #setEnablePositionIncrements(boolean)
*/
public boolean getEnablePositionIncrements() {
return enablePositionIncrements;
}
/**
* Sets the boolean operator of the QueryParser.
* In default mode (<code>OR_OPERATOR</code>) terms without any modifiers
* are considered optional: for example <code>capital of Hungary</code> is equal to
* <code>capital OR of OR Hungary</code>.<br/>
* In <code>AND_OPERATOR</code> mode terms are considered to be in conjunction: the
* above mentioned query is parsed as <code>capital AND of AND Hungary</code>
*/
}
/**
* Gets implicit operator setting, which will be either AND_OPERATOR
* or OR_OPERATOR.
*/
return operator;
}
/**
* Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically
* lower-cased or not. Default is <code>true</code>.
*/
}
/**
* @see #setLowercaseExpandedTerms(boolean)
*/
public boolean getLowercaseExpandedTerms() {
return lowercaseExpandedTerms;
}
/**
* By default QueryParser uses {@link MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT}
* when creating a PrefixQuery, WildcardQuery or RangeQuery. This implementation is generally preferable because it
* a) Runs faster b) Does not have the scarcity of terms unduly influence score
* c) avoids any "TooManyBooleanClauses" exception.
* However, if your application really needs to use the
* old-fashioned BooleanQuery expansion rewriting and the above
* points are not relevant then use this to change
* the rewrite method.
*/
}
/**
* @see #setMultiTermRewriteMethod
*/
return multiTermRewriteMethod;
}
/**
* Set locale used by date range parsing.
*/
}
/**
* Returns current locale, allowing access by subclasses.
*/
return locale;
}
/**
* Sets the default date resolution used by RangeQueries for fields for which no
* specific date resolutions has been set. Field specific resolutions can be set
* with {@link #setDateResolution(String, DateTools.Resolution)}.
*
* @param dateResolution the default date resolution to set
*/
this.dateResolution = dateResolution;
}
/**
* Sets the date resolution used by RangeQueries for a specific field.
*
* @param fieldName field for which the date resolution is to be set
* @param dateResolution date resolution to set
*/
throw new IllegalArgumentException("Field cannot be null.");
}
if (fieldToDateResolution == null) {
// lazily initialize HashMap
}
}
/**
* Returns the date resolution that is used by RangeQueries for the given field.
* Returns null, if no default or field specific date resolution has been set
* for the given field.
*
*/
throw new IllegalArgumentException("Field cannot be null.");
}
if (fieldToDateResolution == null) {
// no field specific date resolutions set; return default date resolution instead
return this.dateResolution;
}
if (resolution == null) {
// no date resolutions set for the given field; return default date resolution instead
resolution = this.dateResolution;
}
return resolution;
}
/**
* Sets the collator used to determine index term inclusion in ranges
* for RangeQuerys.
* <p/>
* <strong>WARNING:</strong> Setting the rangeCollator to a non-null
* collator using this method will cause every single index Term in the
* Depending on the number of index Terms in this Field, the operation could
* be very slow.
*
* @param rc the collator to use when constructing RangeQuerys
*/
rangeCollator = rc;
}
/**
* @return the collator used to determine index term inclusion in ranges
* for RangeQuerys.
*/
return rangeCollator;
}
boolean required, prohibited;
// If this term is introduced by AND, make the preceding term required,
// unless it's already prohibited
if (!c.isProhibited())
}
// If this term is introduced by OR, make the preceding term optional,
// unless it's prohibited (that means we leave -a OR b but +a OR b-->a OR b)
// notice if the input is a OR b, first term is parsed as required; without
// this modification a OR b would parsed as +a OR b
if (!c.isProhibited())
}
// We might have been passed a null query; the term might have been
// filtered away by the analyzer.
if (q == null)
return;
if (operator == OR_OPERATOR) {
// We set REQUIRED if we're introduced by AND or +; PROHIBITED if
// introduced by NOT or -; make sure not to set both.
required = true;
}
} else {
// We set PROHIBITED if we're introduced by NOT or -; We set REQUIRED
// if not PROHIBITED and not introduced by OR
}
if (required && !prohibited)
else if (!required && !prohibited)
else if (!required && prohibited)
else
throw new RuntimeException("Clause cannot be both required and prohibited");
}
/**
* @deprecated Use {@link #getFieldQuery(String,String,boolean)} instead.
*/
// treat the text as if it was quoted, to drive phrase logic with old versions.
}
/**
* @exception ParseException throw in overridden method to disallow
*/
protected Query getFieldQuery(String field, String queryText, boolean quoted) throws ParseException {
// Use the analyzer to get all the tokens, and then build a TermQuery,
// PhraseQuery, or nothing based on the term count
try {
} catch (IOException e) {
}
int numTokens = 0;
boolean success = false;
try {
success = true;
} catch (IOException e) {
// success==false if we hit an exception
}
if (success) {
}
}
}
int positionCount = 0;
boolean severalTokensAtSamePosition = false;
boolean hasMoreTokens = false;
try {
while (hasMoreTokens) {
numTokens++;
if (positionIncrement != 0) {
} else {
severalTokensAtSamePosition = true;
}
}
} catch (IOException e) {
// ignore
}
}
try {
// rewind the buffer stream
// close original stream - all tokens buffered
}
catch (IOException e) {
// ignore
}
if (numTokens == 0)
return null;
else if (numTokens == 1) {
try {
assert hasNext == true;
} catch (IOException e) {
// safe to ignore, because we know the number of tokens
}
} else {
// no phrase query:
for (int i = 0; i < numTokens; i++) {
try {
assert hasNext == true;
} catch (IOException e) {
// safe to ignore, because we know the number of tokens
}
}
return q;
}
else {
// phrase query:
int position = -1;
for (int i = 0; i < numTokens; i++) {
int positionIncrement = 1;
try {
assert hasNext == true;
if (posIncrAtt != null) {
}
} catch (IOException e) {
// safe to ignore, because we know the number of tokens
}
if (enablePositionIncrements) {
} else {
}
multiTerms.clear();
}
}
if (enablePositionIncrements) {
} else {
}
return mpq;
}
}
else {
int position = -1;
for (int i = 0; i < numTokens; i++) {
int positionIncrement = 1;
try {
assert hasNext == true;
if (posIncrAtt != null) {
}
} catch (IOException e) {
// safe to ignore, because we know the number of tokens
}
if (enablePositionIncrements) {
} else {
}
}
return pq;
}
}
}
/**
* Base implementation delegates to {@link #getFieldQuery(String,String,boolean)}.
* This method may be overridden, for example, to return
* a SpanNearQuery instead of a PhraseQuery.
*
* @exception ParseException throw in overridden method to disallow
*/
throws ParseException {
if (query instanceof PhraseQuery) {
}
if (query instanceof MultiPhraseQuery) {
}
return query;
}
/**
* @exception ParseException throw in overridden method to disallow
*/
boolean inclusive) throws ParseException
{
if (lowercaseExpandedTerms) {
}
df.setLenient(true);
try {
if (resolution == null) {
// no default or field specific date resolution has been set,
// use deprecated DateField to maintain compatibility with
// pre-1.9 Lucene versions.
} else {
}
} catch (Exception e) { }
try {
if (inclusive) {
// The user can only specify the date, not the time, so make sure
// the time is set to the latest possible time of that date to really
// include all documents:
}
if (resolution == null) {
// no default or field specific date resolution has been set,
// use deprecated DateField to maintain compatibility with
// pre-1.9 Lucene versions.
} else {
}
} catch (Exception e) { }
}
/**
* Builds a new BooleanQuery instance
* @param disableCoord disable coord
* @return new BooleanQuery instance
*/
return new BooleanQuery(disableCoord);
}
/**
* Builds a new BooleanClause instance
* @param q sub query
* @param occur how this clause should occur when matching documents
* @return new BooleanClause instance
*/
return new BooleanClause(q, occur);
}
/**
* Builds a new TermQuery instance
* @param term term
* @return new TermQuery instance
*/
}
/**
* Builds a new PhraseQuery instance
* @return new PhraseQuery instance
*/
return new PhraseQuery();
}
/**
* Builds a new MultiPhraseQuery instance
* @return new MultiPhraseQuery instance
*/
return new MultiPhraseQuery();
}
/**
* Builds a new PrefixQuery instance
* @param prefix Prefix term
* @return new PrefixQuery instance
*/
return query;
}
/**
* Builds a new FuzzyQuery instance
* @param term Term
* @param minimumSimilarity minimum similarity
* @param prefixLength prefix length
* @return new FuzzyQuery Instance
*/
// FuzzyQuery doesn't yet allow constant score rewrite
}
/**
* Builds a new TermRangeQuery instance
* @param field Field
* @param part1 min
* @param part2 max
* @param inclusive true if range is inclusive
* @return new TermRangeQuery instance
*/
final TermRangeQuery query = new TermRangeQuery(field, part1, part2, inclusive, inclusive, rangeCollator);
return query;
}
/**
* Builds a new MatchAllDocsQuery instance
* @return new MatchAllDocsQuery instance
*/
return new MatchAllDocsQuery();
}
/**
* Builds a new WildcardQuery instance
* @param t wildcard term
* @return new WildcardQuery instance
*/
return query;
}
/**
* Factory method for generating query, given a set of clauses.
* By default creates a boolean query composed of clauses passed in.
*
* Can be overridden by extending classes, to modify query being
* returned.
*
* @param clauses List that contains {@link BooleanClause} instances
* to join.
*
* @return Resulting {@link Query} object.
* @exception ParseException throw in overridden method to disallow
*/
return getBooleanQuery(clauses, false);
}
/**
* Factory method for generating query, given a set of clauses.
* By default creates a boolean query composed of clauses passed in.
*
* Can be overridden by extending classes, to modify query being
* returned.
*
* @param clauses List that contains {@link BooleanClause} instances
* to join.
* @param disableCoord true if coord scoring should be disabled.
*
* @return Resulting {@link Query} object.
* @exception ParseException throw in overridden method to disallow
*/
throws ParseException
{
return null; // all clause words were filtered away by the analyzer.
}
}
return query;
}
/**
* Factory method for generating a query. Called when parser
* parses an input term token that contains one or more wildcard
* characters (? and *), but is not a prefix term token (one
* that has just a single * character at the end)
*<p>
* Depending on settings, prefix term may be lower-cased
* automatically. It will not go through the default Analyzer,
* however, since normal Analyzers are unlikely to work properly
* with wildcard templates.
*<p>
* Can be overridden by extending classes, to provide custom handling for
* wildcard queries, which may be necessary due to missing analyzer calls.
*
* @param field Name of the field query will use.
* @param termStr Term token that contains one or more wild card
* characters (? or *), but is not simple prefix term
*
* @return Resulting {@link Query} built for the term
* @exception ParseException throw in overridden method to disallow
*/
{
}
throw new ParseException("'*' or '?' not allowed as first character in WildcardQuery");
if (lowercaseExpandedTerms) {
}
return newWildcardQuery(t);
}
/**
* Factory method for generating a query (similar to
* {@link #getWildcardQuery}). Called when parser parses an input term
* token that uses prefix notation; that is, contains a single '*' wildcard
* character as its last character. Since this is a special case
* of generic wildcard term, and such a query can be optimized easily,
* this usually results in a different query object.
*<p>
* Depending on settings, a prefix term may be lower-cased
* automatically. It will not go through the default Analyzer,
* however, since normal Analyzers are unlikely to work properly
* with wildcard templates.
*<p>
* Can be overridden by extending classes, to provide custom handling for
* wild card queries, which may be necessary due to missing analyzer calls.
*
* @param field Name of the field query will use.
* @param termStr Term token to use for building term for the query
* (<b>without</b> trailing '*' character!)
*
* @return Resulting {@link Query} built for the term
* @exception ParseException throw in overridden method to disallow
*/
{
throw new ParseException("'*' not allowed as first character in PrefixQuery");
if (lowercaseExpandedTerms) {
}
return newPrefixQuery(t);
}
/**
* Factory method for generating a query (similar to
* {@link #getWildcardQuery}). Called when parser parses
* an input term token that has the fuzzy suffix (~) appended.
*
* @param field Name of the field query will use.
* @param termStr Term token to use for building term for the query
*
* @return Resulting {@link Query} built for the term
* @exception ParseException throw in overridden method to disallow
*/
protected Query getFuzzyQuery(String field, String termStr, float minSimilarity) throws ParseException
{
if (lowercaseExpandedTerms) {
}
}
/**
* Returns a String where the escape char has been
* removed, or kept only once if there was a double escape.
*
* Supports escaped unicode characters, e. g. translates
* <code>\\u0041</code> to <code>A</code>.
*
*/
// Create char array to hold unescaped char sequence
// The length of the output can be less than the input
// due to discarded escape chars. This variable holds
// the actual length of the output
int length = 0;
// We remember whether the last processed character was
// an escape character
boolean lastCharWasEscapeChar = false;
// The multiplier the current unicode digit must be multiplied with.
// E. g. the first digit must be multiplied with 16^3, the second with 16^2...
int codePointMultiplier = 0;
// Used to calculate the codepoint of the escaped unicode character
int codePoint = 0;
if (codePointMultiplier > 0) {
codePointMultiplier >>>= 4;
if (codePointMultiplier == 0) {
codePoint = 0;
}
} else if (lastCharWasEscapeChar) {
if (curChar == 'u') {
// found an escaped unicode character
} else {
// this character was escaped
length++;
}
lastCharWasEscapeChar = false;
} else {
if (curChar == '\\') {
lastCharWasEscapeChar = true;
} else {
length++;
}
}
}
if (codePointMultiplier > 0) {
throw new ParseException("Truncated unicode escape sequence.");
}
if (lastCharWasEscapeChar) {
throw new ParseException("Term can not end with escape character.");
}
}
/** Returns the numeric value of the hexadecimal character */
if ('0' <= c && c <= '9') {
return c - '0';
} else if ('a' <= c && c <= 'f'){
return c - 'a' + 10;
} else if ('A' <= c && c <= 'F') {
return c - 'A' + 10;
} else {
throw new ParseException("None-hex character in unicode escape sequence: " + c);
}
}
/**
* Returns a String where those characters that QueryParser
* expects to be escaped are escaped by a preceding <code>\</code>.
*/
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
// These characters are part of the query syntax and must be escaped
if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':'
|| c == '^' || c == '[' || c == ']' || c == '\"' || c == '{' || c == '}' || c == '~'
|| c == '*' || c == '?' || c == '|' || c == '&') {
}
}
}
/**
* Command line tool to test QueryParser, using {@link org.apache.lucene.analysis.SimpleAnalyzer}.
* Usage:<br>
* <code>java org.apache.lucene.queryParser.QueryParser <input></code>
*/
}
}
// * Query ::= ( Clause )*
// * Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" )
case AND:
case OR:
case AND:
break;
case OR:
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
;
}
{if (true) return ret;}
throw new Error("Missing return statement in function");
}
case NOT:
case PLUS:
case MINUS:
case PLUS:
break;
case MINUS:
break;
case NOT:
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
;
}
{if (true) return ret;}
throw new Error("Missing return statement in function");
}
// This makes sure that there is no garbage after the query string
Query q;
jj_consume_token(0);
{if (true) return q;}
throw new Error("Missing return statement in function");
}
firstQuery=q;
while (true) {
case AND:
case OR:
case NOT:
case PLUS:
case MINUS:
case LPAREN:
case STAR:
case QUOTED:
case TERM:
case PREFIXTERM:
case WILDTERM:
case RANGEIN_START:
case RANGEEX_START:
case NUMBER:
;
break;
default:
break label_1;
}
conj = Conjunction();
}
{if (true) return firstQuery;}
else {
{if (true) return getBooleanQuery(clauses);}
}
throw new Error("Missing return statement in function");
}
Query q;
if (jj_2_1(2)) {
case TERM:
break;
case STAR:
field="*";
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
} else {
;
}
case STAR:
case QUOTED:
case TERM:
case PREFIXTERM:
case WILDTERM:
case RANGEIN_START:
case RANGEEX_START:
case NUMBER:
break;
case LPAREN:
case CARAT:
break;
default:
;
}
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
float f = (float)1.0;
try {
q.setBoost(f);
}
{if (true) return q;}
throw new Error("Missing return statement in function");
}
boolean prefix = false;
boolean wildcard = false;
boolean fuzzy = false;
Query q;
case STAR:
case TERM:
case PREFIXTERM:
case WILDTERM:
case NUMBER:
case TERM:
break;
case STAR:
wildcard=true;
break;
case PREFIXTERM:
prefix=true;
break;
case WILDTERM:
wildcard=true;
break;
case NUMBER:
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
case FUZZY_SLOP:
fuzzy=true;
break;
default:
;
}
case CARAT:
case FUZZY_SLOP:
fuzzy=true;
break;
default:
;
}
break;
default:
;
}
if (wildcard) {
} else if (prefix) {
q = getPrefixQuery(field,
} else if (fuzzy) {
float fms = fuzzyMinSim;
try {
{if (true) throw new ParseException("Minimum similarity for a FuzzyQuery has to be between 0.0f and 1.0f !");}
}
} else {
}
break;
case RANGEIN_START:
case RANGEIN_GOOP:
break;
case RANGEIN_QUOTED:
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
case RANGEIN_TO:
break;
default:
;
}
case RANGEIN_GOOP:
break;
case RANGEIN_QUOTED:
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
case CARAT:
break;
default:
;
}
{
boolean startOpen=false;
boolean endOpen=false;
startOpen = true;
}
endOpen = true;
}
q = getRangeQuery(field, startOpen ? null : discardEscapeChar(goop1.image), endOpen ? null : discardEscapeChar(goop2.image), true);
}
break;
case RANGEEX_START:
case RANGEEX_GOOP:
break;
case RANGEEX_QUOTED:
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
case RANGEEX_TO:
break;
default:
;
}
case RANGEEX_GOOP:
break;
case RANGEEX_QUOTED:
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
case CARAT:
break;
default:
;
}
{
boolean startOpen=false;
boolean endOpen=false;
startOpen = true;
}
endOpen = true;
}
q = getRangeQuery(field, startOpen ? null : discardEscapeChar(goop1.image), endOpen ? null : discardEscapeChar(goop2.image), false);
}
break;
case QUOTED:
case FUZZY_SLOP:
break;
default:
;
}
case CARAT:
break;
default:
;
}
int s = phraseSlop;
try {
}
}
break;
default:
jj_consume_token(-1);
throw new ParseException();
}
float f = (float) 1.0;
try {
}
/* Should this be handled somehow? (defaults to "no boost", if
* boost number is invalid)
*/
}
// avoid boosting null queries, such as those caused by stop words
if (q != null) {
q.setBoost(f);
}
}
{if (true) return q;}
throw new Error("Missing return statement in function");
}
try { return !jj_3_1(); }
catch(LookaheadSuccess ls) { return true; }
}
private boolean jj_3R_2() {
if (jj_scan_token(TERM)) return true;
if (jj_scan_token(COLON)) return true;
return false;
}
private boolean jj_3_1() {
xsp = jj_scanpos;
if (jj_3R_2()) {
jj_scanpos = xsp;
if (jj_3R_3()) return true;
}
return false;
}
private boolean jj_3R_3() {
if (jj_scan_token(STAR)) return true;
if (jj_scan_token(COLON)) return true;
return false;
}
/** Generated Token Manager. */
/** Current token. */
/** Next token. */
private int jj_ntk;
private int jj_la;
private int jj_gen;
static private int[] jj_la1_0;
static private int[] jj_la1_1;
static {
}
private static void jj_la1_init_0() {
jj_la1_0 = new int[] {0x300,0x300,0x1c00,0x1c00,0x3ed3f00,0x90000,0x20000,0x3ed2000,0x2690000,0x100000,0x100000,0x20000,0x30000000,0x4000000,0x30000000,0x20000,0x0,0x40000000,0x0,0x20000,0x100000,0x20000,0x3ed0000,};
}
private static void jj_la1_init_1() {
jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0x3,0x0,0x0,0x0,0x0,};
}
private boolean jj_rescan = false;
/** Constructor with user supplied CharStream. */
jj_ntk = -1;
jj_gen = 0;
}
/** Reinitialise. */
jj_ntk = -1;
jj_gen = 0;
}
/** Constructor with generated Token Manager. */
token_source = tm;
jj_ntk = -1;
jj_gen = 0;
}
/** Reinitialise. */
token_source = tm;
jj_ntk = -1;
jj_gen = 0;
}
jj_ntk = -1;
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
while (c != null) {
c = c.next;
}
}
}
return token;
}
throw generateParseException();
}
if (jj_scanpos == jj_lastpos) {
jj_la--;
} else {
}
} else {
}
if (jj_rescan) {
}
return false;
}
/** Get the next Token. */
jj_ntk = -1;
jj_gen++;
return token;
}
/** Get the specific Token. */
for (int i = 0; i < index; i++) {
}
return t;
}
private int jj_ntk() {
else
}
private int[] jj_expentry;
private int jj_endpos;
if (pos >= 100) return;
} else if (jj_endpos != 0) {
jj_expentry = new int[jj_endpos];
for (int i = 0; i < jj_endpos; i++) {
jj_expentry[i] = jj_lasttokens[i];
}
if (oldentry[i] != jj_expentry[i]) {
continue jj_entries_loop;
}
}
break jj_entries_loop;
}
}
}
}
/** Generate ParseException. */
boolean[] la1tokens = new boolean[34];
if (jj_kind >= 0) {
jj_kind = -1;
}
for (int i = 0; i < 23; i++) {
for (int j = 0; j < 32; j++) {
la1tokens[j] = true;
}
la1tokens[32+j] = true;
}
}
}
}
for (int i = 0; i < 34; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
}
}
jj_endpos = 0;
}
}
/** Enable tracing. */
final public void enable_tracing() {
}
/** Disable tracing. */
final public void disable_tracing() {
}
private void jj_rescan_token() {
jj_rescan = true;
for (int i = 0; i < 1; i++) {
try {
do {
switch (i) {
case 0: jj_3_1(); break;
}
}
p = p.next;
} while (p != null);
} catch(LookaheadSuccess ls) { }
}
jj_rescan = false;
}
p = p.next;
}
}
static final class JJCalls {
int gen;
int arg;
}
}