Class QueryParser


  • public final class QueryParser
    extends Object
    Simple query to predicate constructor for basic keyword queries over corpora. Syntax is as follows:
    • 'TERM' - keyword or phrase
    • AND - and terms
    • OR - or terms
    • - - not term
    • $ATTRIBUTE(value) - filter based on exact matches for document level attributes
    Order of operations can be controlled using parenthesis
    Author:
    David B. Bracewell
    • Constructor Detail

      • QueryParser

        public QueryParser()
    • Method Detail

      • parse

        public static Query parse​(String query)
                           throws ParseException
        Parses the given query in string form into a Query object.
        Parameters:
        query - the query to parse
        Returns:
        the Query represented by the
        Throws:
        ParseException - error parsing the query