Class FunctionQParser


  • public class FunctionQParser
    extends QParser
    • Field Detail

      • FLAG_USE_FIELDNAME_SOURCE

        public static final int FLAG_USE_FIELDNAME_SOURCE
        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.
    • 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 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
      • parseDouble

        public double parseDouble()
                           throws SyntaxError
        Parse a Double
        Returns:
        double
        Throws:
        SyntaxError
      • argWasQuoted

        public boolean argWasQuoted()
      • parseValueSourceList

        public List<org.apache.lucene.queries.function.ValueSource> parseValueSourceList()
                                                                                  throws SyntaxError
        Parse a list of ValueSource. Must be the final set of arguments to a ValueSource.
        Returns:
        List<ValueSource>
        Throws:
        SyntaxError
      • parseValueSourceList

        public List<org.apache.lucene.queries.function.ValueSource> parseValueSourceList​(int flags)
                                                                                  throws SyntaxError
        Parse a list of ValueSource. Must be the final set of arguments to a ValueSource.
        Parameters:
        flags - - customize parsing behavior
        Returns:
        List<ValueSource>
        Throws:
        SyntaxError
      • parseValueSource

        public org.apache.lucene.queries.function.ValueSource parseValueSource()
                                                                        throws SyntaxError
        Parse an individual ValueSource.
        Throws:
        SyntaxError
      • parseNestedQuery

        public org.apache.lucene.search.Query parseNestedQuery()
                                                        throws SyntaxError
        Throws:
        SyntaxError
      • parseValueSource

        protected org.apache.lucene.queries.function.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 org.apache.lucene.queries.function.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