org.compass.core.lucene.engine.queryparser
Class CompassQueryParser
java.lang.Object
org.apache.lucene.queryParser.QueryParser
org.compass.core.lucene.engine.queryparser.CompassQueryParser
- All Implemented Interfaces:
- QueryParserConstants
public class CompassQueryParser
- extends QueryParser
Extends Lucene QueryParser and overrides getRangeQuery(String,String,String,boolean)
since lucene performs data parsing which is a performance killer. Anyhow, handling dates in Compass
is different and simpler than Lucene.
- Author:
- kimchy
| Fields inherited from interface org.apache.lucene.queryParser.QueryParserConstants |
_ESCAPED_CHAR, _NUM_CHAR, _TERM_CHAR, _TERM_START_CHAR, _WHITESPACE, AND, Boost, CARAT, COLON, DEFAULT, EOF, FUZZY_SLOP, LPAREN, MINUS, NOT, NUMBER, OR, PLUS, PREFIXTERM, QUOTED, RangeEx, RANGEEX_END, RANGEEX_GOOP, RANGEEX_QUOTED, RANGEEX_START, RANGEEX_TO, RangeIn, RANGEIN_END, RANGEIN_GOOP, RANGEIN_QUOTED, RANGEIN_START, RANGEIN_TO, RPAREN, STAR, TERM, tokenImage, WILDTERM |
| Methods inherited from class org.apache.lucene.queryParser.QueryParser |
addClause, Clause, Conjunction, disable_tracing, enable_tracing, escape, generateParseException, getAllowLeadingWildcard, getAnalyzer, getBooleanQuery, getBooleanQuery, getDateResolution, getDefaultOperator, getField, getFieldQuery, getFuzzyMinSim, getFuzzyPrefixLength, getLocale, getLowercaseExpandedTerms, getNextToken, getPhraseSlop, getToken, getUseOldRangeQuery, main, Modifiers, parse, Query, ReInit, ReInit, setAllowLeadingWildcard, setDateResolution, setDateResolution, setDefaultOperator, setFuzzyMinSim, setFuzzyPrefixLength, setLocale, setLowercaseExpandedTerms, setPhraseSlop, setUseOldRangeQuery, Term, TopLevelQuery |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompassQueryParser
public CompassQueryParser(String f,
Analyzer a,
CompassMapping mapping)
setAllowConstantScorePrefixQuery
public void setAllowConstantScorePrefixQuery(boolean allowConstantScorePrefixQuery)
getWildcardQuery
protected Query getWildcardQuery(String field,
String termStr)
throws ParseException
- Overrides:
getWildcardQuery in class QueryParser
- Throws:
ParseException
getFuzzyQuery
protected Query getFuzzyQuery(String field,
String termStr,
float minSimilarity)
throws ParseException
- Overrides:
getFuzzyQuery in class QueryParser
- Throws:
ParseException
getFieldQuery
protected Query getFieldQuery(String field,
String queryText)
throws ParseException
- Overrides:
getFieldQuery in class QueryParser
- Throws:
ParseException
getRangeQuery
protected Query getRangeQuery(String field,
String part1,
String part2,
boolean inclusive)
throws ParseException
- Override it so we won't use the date format to try and parse dates
- Overrides:
getRangeQuery in class QueryParser
- Throws:
ParseException
getPrefixQuery
protected Query getPrefixQuery(String field,
String termStr)
throws ParseException
- Overrides:
getPrefixQuery in class QueryParser
- Throws:
ParseException
Copyright (c) 2004-2006 The Compass Project.