SOLR-601: make QParser.parse public

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@668656 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2008-06-17 13:27:53 +00:00
parent a1b02cc58b
commit e108b5375c
1 changed files with 9 additions and 2 deletions

View File

@ -40,8 +40,10 @@ public abstract class QParser {
this.req = req;
}
/** create and return the <code>Query</code> object represented by <code>qstr</code> */
protected abstract Query parse() throws ParseException;
/** Create and return the <code>Query</code> object represented by <code>qstr</code>
* @see #getQuery()
**/
public abstract Query parse() throws ParseException;
public SolrParams getLocalParams() {
return localParams;
@ -75,6 +77,11 @@ public abstract class QParser {
this.qstr = s;
}
/** Returns the resulting query from this QParser, calling parse() only the
* first time and caching the Query result.
* @return
* @throws ParseException
*/
public Query getQuery() throws ParseException {
if (query==null) {
query=parse();