mirror of https://github.com/apache/lucene.git
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:
parent
a1b02cc58b
commit
e108b5375c
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue