org.apache.solr.search
Class FunctionQParser

java.lang.Object
  extended by org.apache.solr.search.QParser
      extended by org.apache.solr.search.FunctionQParser

public class FunctionQParser
extends QParser


Field Summary
 QueryParsing.StrParser sp
           
 
Fields inherited from class org.apache.solr.search.QParser
localParams, localParamsEnd, params, qstr, query, recurseCount, req, stringIncludingLocalParams, valFollowedParams
 
Constructor Summary
FunctionQParser(String qstr, org.apache.solr.common.params.SolrParams localParams, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
           
 
Method Summary
 boolean argWasQuoted()
           
protected  boolean consumeArgumentDelimiter()
          Consume an argument delimiter (a comma) from the token stream.
 boolean getParseMultipleSources()
          parse multiple comma separated value sources
 boolean getParseToEnd()
          throw exception if there is extra stuff at the end of the parsed valuesource(s).
 boolean hasMoreArguments()
          Are there more arguments in the argument list being parsed?
 org.apache.lucene.search.Query parse()
          Create and return the Query object represented by qstr
 String parseArg()
           
 double parseDouble()
          Parse a Double
 Float parseFloat()
          Parse a float.
 String parseId()
          TODO: Doc
 int parseInt()
          Parse an integer
 org.apache.lucene.search.Query parseNestedQuery()
          TODO: Doc
 ValueSource parseValueSource()
          Parse an individual ValueSource.
protected  ValueSource parseValueSource(boolean doConsumeDelimiter)
          Parse an individual value source.
 List<ValueSource> parseValueSourceList()
          Parse a list of ValueSource.
 void setParseMultipleSources(boolean parseMultipleSources)
           
 void setParseToEnd(boolean parseToEnd)
           
 
Methods inherited from class org.apache.solr.search.QParser
addDebugInfo, getDefaultHighlightFields, getHighlightQuery, getLocalParams, getParam, getParams, getParser, getQuery, getReq, getSort, getString, setLocalParams, setParams, setReq, setString, subQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sp

public QueryParsing.StrParser sp
NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
Constructor Detail

FunctionQParser

public FunctionQParser(String qstr,
                       org.apache.solr.common.params.SolrParams localParams,
                       org.apache.solr.common.params.SolrParams params,
                       SolrQueryRequest req)
Method Detail

setParseMultipleSources

public void setParseMultipleSources(boolean parseMultipleSources)

getParseMultipleSources

public boolean getParseMultipleSources()
parse multiple comma separated value sources


setParseToEnd

public void setParseToEnd(boolean parseToEnd)

getParseToEnd

public boolean getParseToEnd()
throw exception if there is extra stuff at the end of the parsed valuesource(s).


parse

public org.apache.lucene.search.Query parse()
                                     throws org.apache.lucene.queryParser.ParseException
Description copied from class: QParser
Create and return the Query object represented by qstr

Specified by:
parse in class QParser
Throws:
org.apache.lucene.queryParser.ParseException
See Also:
QParser.getQuery()

hasMoreArguments

public boolean hasMoreArguments()
                         throws org.apache.lucene.queryParser.ParseException
Are there more arguments in the argument list being parsed?

Returns:
whether more args exist
Throws:
org.apache.lucene.queryParser.ParseException

parseId

public String parseId()
               throws org.apache.lucene.queryParser.ParseException
TODO: Doc

Throws:
org.apache.lucene.queryParser.ParseException

parseFloat

public Float parseFloat()
                 throws org.apache.lucene.queryParser.ParseException
Parse a float.

Returns:
Float
Throws:
org.apache.lucene.queryParser.ParseException

parseDouble

public double parseDouble()
                   throws org.apache.lucene.queryParser.ParseException
Parse a Double

Returns:
double
Throws:
org.apache.lucene.queryParser.ParseException

parseInt

public int parseInt()
             throws org.apache.lucene.queryParser.ParseException
Parse an integer

Returns:
An int
Throws:
org.apache.lucene.queryParser.ParseException

argWasQuoted

public boolean argWasQuoted()

parseArg

public String parseArg()
                throws org.apache.lucene.queryParser.ParseException
Throws:
org.apache.lucene.queryParser.ParseException

parseValueSourceList

public List<ValueSource> parseValueSourceList()
                                       throws org.apache.lucene.queryParser.ParseException
Parse a list of ValueSource. Must be the final set of arguments to a ValueSource.

Returns:
List
Throws:
org.apache.lucene.queryParser.ParseException

parseValueSource

public ValueSource parseValueSource()
                             throws org.apache.lucene.queryParser.ParseException
Parse an individual ValueSource.

Throws:
org.apache.lucene.queryParser.ParseException

parseNestedQuery

public org.apache.lucene.search.Query parseNestedQuery()
                                                throws org.apache.lucene.queryParser.ParseException
TODO: Doc

Throws:
org.apache.lucene.queryParser.ParseException

parseValueSource

protected ValueSource parseValueSource(boolean doConsumeDelimiter)
                                throws org.apache.lucene.queryParser.ParseException
Parse an individual value source.

Parameters:
doConsumeDelimiter - whether to consume a delimiter following the ValueSource
Throws:
org.apache.lucene.queryParser.ParseException

consumeArgumentDelimiter

protected boolean consumeArgumentDelimiter()
                                    throws org.apache.lucene.queryParser.ParseException
Consume an argument delimiter (a comma) from the token stream. Only consumes if more arguments should exist (no ending parens or end of string).

Returns:
whether a delimiter was consumed
Throws:
org.apache.lucene.queryParser.ParseException


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.