Class QueryNode

java.lang.Object
redis.clients.jedis.search.querybuilder.QueryNode
All Implemented Interfaces:
Node
Direct Known Subclasses:
IntersectNode, UnionNode

public abstract class QueryNode extends Object implements Node
  • Field Details

    • children

      private final List<Node> children
  • Constructor Details

    • QueryNode

      public QueryNode()
  • Method Details

    • getJoinString

      protected abstract String getJoinString()
    • add

      public QueryNode add(String field, Value... values)
      Add a match criteria to this node
      Parameters:
      field - The field to check. If null or empty, then any field is checked
      values - Values to check for.
      Returns:
      The current node, for chaining.
    • add

      public QueryNode add(String field, String... values)
      Convenience method to add a list of string values
      Parameters:
      field - Field to check for
      values - One or more string values.
      Returns:
      The current node, for chaining.
    • add

      public QueryNode add(String field, Collection<Value> values)
      Add a list of values from a collection
      Parameters:
      field - The field to check
      values - Collection of values to match
      Returns:
      The current node for chaining.
    • add

      public QueryNode add(Node... nodes)
      Add children nodes to this node.
      Parameters:
      nodes - Children nodes to add
      Returns:
      The current node, for chaining.
    • shouldParenthesize

      protected boolean shouldParenthesize(Node.Parenthesize mode)
    • toString

      public String toString(Node.Parenthesize parenMode)
      Description copied from interface: Node
      Returns the string form of this node.
      Specified by:
      toString in interface Node
      Parameters:
      parenMode - Whether the string should be encapsulated in parentheses (...)
      Returns:
      The string query.
    • toString

      public String toString()
      Description copied from interface: Node
      Returns the string form of this node. This may be passed to UnifiedJedis.ftSearch(String, Query)
      Specified by:
      toString in interface Node
      Overrides:
      toString in class Object
      Returns:
      The query string.