Package com.sun.labs.minion.query

Classes for providing programattic querying.

See:
          Description

Class Summary
And A boolean and operator
Element An abstract class for an element in a query: the elements of a query are terms, operators, relations and ranges.
Not A boolean not operator.
Operator An abstract class for a query operator.
Or A boolean or operator.
Range A range query.
Relation A class for a simple relational query, like price < 10.
StringRelation A query element for the string operators, which includes all of the valid operators from Relation, as well as substring, matches, starts, ends.
Term A class for a search term.
 

Enum Summary
Relation.Operator The saved field operators.
Term.Modifier The modifiers that affect which terms will be pulled from the index for the given query term.
 

Package com.sun.labs.minion.query Description

Classes for providing programattic querying. These classes provide a way to run queries without having to embed queries written in one of the Minion query languages.

This can make things a lot easier in a number of instances. For example, if you want to find fields whose value is equal to a value provided by a user, then you can use the programattic API to build a query like:

        String value = ...;
        StringRelation r = new StringRelation("title", Relation.Operator.EQUALS, value);
        ResultSet rs = engine.search(r);
        

If you're trying to use the query language to do the same thing, then you need to beware of values that have single or double quotes in them, since these will need to be escaped before they can be passed to the query parser.