Class QueryBuilders
java.lang.Object
redis.clients.jedis.search.querybuilder.QueryBuilders
Created by mnunberg on 2/23/18.
This class contains methods to construct query nodes. These query nodes can be added to parent
query nodes (building a chain) or used as the root query node.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QueryNodeCreate a disjunct node using one or more values.static QueryNodeCreate a disjunct node using one or more values.static QueryNodeCreate a disjunct node.static QueryNodedisjunctUnion(String field, String... values) static QueryNodedisjunctUnion(String field, Value... values) static QueryNodedisjunctUnion(Node... n) Create a disjunct union node.static QueryNodeHelper method to create a new intersection node with a string value.static QueryNodeCreate a new intersection node with a field-value pair.static QueryNodeCreate a new intersection node with child nodes.static QueryNodestatic QueryNodeCreate an optional node.static QueryNodeConvenience method to match one or more strings.static QueryNodeCreate a union node which can match an one or more valuesstatic QueryNodeCreate a union node.
-
Constructor Details
-
QueryBuilders
private QueryBuilders()
-
-
Method Details
-
intersect
Create a new intersection node with child nodes. An intersection node is true if all its children are also true- Parameters:
n- sub-condition to add- Returns:
- The node
-
intersect
Create a new intersection node with a field-value pair.- Parameters:
field- The field that should contain this value. If this value is empty, then any field will be checked.values- Value to check for. The node will be true only if the field (or any field) contains all of the values- Returns:
- The node
-
intersect
Helper method to create a new intersection node with a string value.- Parameters:
field- The field to check. If left null or empty, all fields will be checked.stringValue- The value to check- Returns:
- The node
-
union
Create a union node. Union nodes evaluate to true if any of its children are true- Parameters:
n- Child node- Returns:
- The union node
-
union
Create a union node which can match an one or more values- Parameters:
field- Field to check. If empty, all fields are checkedvalues- Values to search for. The node evaluates to true iffieldmatches any of the values- Returns:
- The union node
-
union
Convenience method to match one or more strings. This is equivalent tounion(field, value(v1), value(v2), value(v3)) ...- Parameters:
field- Field to matchvalues- Strings to check for- Returns:
- The union node
-
disjunct
Create a disjunct node. Disjunct nodes are true iff any of its children are not true. Conversely, this node evaluates to false if all its children are true.- Parameters:
n- Child nodes to add- Returns:
- The disjunct node
-
disjunct
Create a disjunct node using one or more values. The node will evaluate to true iff the field does not match any of the values.- Parameters:
field- Field to check for (empty or null for any field)values- The values to check for- Returns:
- The node
-
disjunct
Create a disjunct node using one or more values. The node will evaluate to true iff the field does not match any of the values.- Parameters:
field- Field to check for (empty or null for any field)values- The values to check for- Returns:
- The node
-
disjunctUnion
Create a disjunct union node. This node evaluates to true if all of its children are not true. Conversely, this node evaluates as false if any of its children are true.- Parameters:
n-- Returns:
- The node
-
disjunctUnion
-
disjunctUnion
-
optional
Create an optional node. Optional nodes do not affect which results are returned but they influence ordering and scoring.- Parameters:
n- The node to evaluate as optional- Returns:
- The new node
-
optional
-