org.apache.solr.search

## Class FunctionQParser

- java.lang.Object
- - org.apache.solr.search.QParser
  - - org.apache.solr.search.FunctionQParser

-     public class FunctionQParser
      extends QParser

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `FLAG_CONSUME_DELIMITER`
    `static int` | `FLAG_DEFAULT`
    `static int` | `FLAG_IS_AGG`
    `StrParser` | `sp`

    - ### Fields inherited from class org.apache.solr.search.QParser

      `localParams, localParamsEnd, params, qstr, query, recurseCount, req, stringIncludingLocalParams, valFollowedParams`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FunctionQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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?
    `Query` | `parse()` Create and return the `Query` object represented by `qstr`.
    `AggValueSource` | `parseAgg(int flags)`
    `String` | `parseArg()`
    `double` | `parseDouble()` Parse a Double
    `Float` | `parseFloat()` Parse a float.
    `String` | `parseId()`
    `int` | `parseInt()` Parse an integer
    `Query` | `parseNestedQuery()`
    `ValueSource` | `parseValueSource()` Parse an individual ValueSource.
    `protected ValueSource` | `parseValueSource(boolean doConsumeDelimiter)` Parse an individual value source.
    `protected ValueSource` | `parseValueSource(int flags)`
    `List<ValueSource>` | `parseValueSourceList()` Parse a list of ValueSource.
    `void` | `setParseMultipleSources(boolean parseMultipleSources)`
    `void` | `setParseToEnd(boolean parseToEnd)`
    `void` | `setString(String s)`

    - ### Methods inherited from class org.apache.solr.search.QParser

      `addDebugInfo, getDefaultHighlightFields, getHighlightQuery, getLocalParams, getParam, getParams, getParser, getParser, getQuery, getReq, getSort, getSortSpec, getString, setLocalParams, setParams, setReq, subQuery`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### FLAG_CONSUME_DELIMITER

          public static final int FLAG_CONSUME_DELIMITER

      See Also:
        Constant Field Values

    - #### FLAG_IS_AGG

          public static final int FLAG_IS_AGG

      See Also:
        Constant Field Values

    - #### FLAG_DEFAULT

          public static final int FLAG_DEFAULT

      See Also:
        Constant Field Values

    - #### sp

          public 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,
                                 SolrParams localParams,
                                 SolrParams params,
                                 SolrQueryRequest req)

  - ### Method Detail

    - #### setString

          public void setString(String s)

      Overrides:
        `setString` in class `QParser`

    - #### 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 Query parse()
                      throws SyntaxError

      Description copied from class: `QParser`
      Create and return the `Query` object represented by `qstr`. Null MAY be returned to signify there was no input (e.g. no query string) to parse.
      Specified by:
        `parse` in class `QParser`
      Throws:
        `SyntaxError`
      See Also:
        `QParser.getQuery()`

    - #### hasMoreArguments

          public boolean hasMoreArguments()
                                   throws SyntaxError

      Are there more arguments in the argument list being parsed?
      Returns:
        whether more args exist
      Throws:
        `SyntaxError`

    - #### parseId

          public String parseId()
                         throws SyntaxError

      Throws:
        `SyntaxError`

    - #### parseFloat

          public Float parseFloat()
                           throws SyntaxError

      Parse a float.
      Returns:
        Float
      Throws:
        `SyntaxError`

    - #### parseDouble

          public double parseDouble()
                             throws SyntaxError

      Parse a Double
      Returns:
        double
      Throws:
        `SyntaxError`

    - #### parseInt

          public int parseInt()
                       throws SyntaxError

      Parse an integer
      Returns:
        An int
      Throws:
        `SyntaxError`

    - #### argWasQuoted

          public boolean argWasQuoted()

    - #### parseArg

          public String parseArg()
                          throws SyntaxError

      Throws:
        `SyntaxError`

    - #### parseValueSourceList

          public List<ValueSource> parseValueSourceList()
                                                 throws SyntaxError

      Parse a list of ValueSource. Must be the final set of arguments to a ValueSource.
      Returns:
        List<ValueSource>
      Throws:
        `SyntaxError`

    - #### parseValueSource

          public ValueSource parseValueSource()
                                       throws SyntaxError

      Parse an individual ValueSource.
      Throws:
        `SyntaxError`

    - #### parseNestedQuery

          public Query parseNestedQuery()
                                 throws SyntaxError

      Throws:
        `SyntaxError`

    - #### parseValueSource

          protected ValueSource parseValueSource(boolean doConsumeDelimiter)
                                          throws SyntaxError

      Parse an individual value source.
      Parameters:
        `doConsumeDelimiter` - whether to consume a delimiter following the ValueSource
      Throws:
        `SyntaxError`

    - #### parseValueSource

          protected ValueSource parseValueSource(int flags)
                                          throws SyntaxError

      Throws:
        `SyntaxError`

    - #### parseAgg

          public AggValueSource parseAgg(int flags)
                                  throws SyntaxError

      Throws:
        `SyntaxError`
      WARNING: This API is experimental and might change in incompatible ways in the next release.

    - #### consumeArgumentDelimiter

          protected boolean consumeArgumentDelimiter()
                                              throws SyntaxError

      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:
        `SyntaxError`

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