Class QueryTreeAction
- java.lang.Object
-
- com.lucidworks.search.dsl.request.query.walk.QueryTreeAction
-
public class QueryTreeAction extends java.lang.Object
Identifies what should be done at a particular node of the query tree, while walking it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryTreeAction.Action
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryTreeAction.Action
getAction()
Query
getReplacement()
static QueryTreeAction
keep()
Do not modify the current node, but possibly modify its children (if any).static QueryTreeAction
remove()
remove the current nodestatic QueryTreeAction
replace(Query replacement)
Replace the current node with the provided replacement.
-
-
-
Method Detail
-
keep
public static QueryTreeAction keep()
Do not modify the current node, but possibly modify its children (if any). If this node returns isEmptyQuery() after processing children, this node itself will be removed from the query tree.
-
replace
public static QueryTreeAction replace(Query replacement)
Replace the current node with the provided replacement. It's allowed to use a modified version of this query as the replacement rather than allocating and using a new instance of the query as the replacement. This will behave like keep() (this node's children will be processed) if the replacement is the same instance as the original node. It will simply replace and NOT process the children if the replacement is a different instance (this is to prevent risk of accidental infinite recursion or double-visiting). If the provided replacement has isEmptyQuery=true, this node will simply be removed from the query tree instead (just like remove()). This is to prevent accidentaly leaving an empty "do nothing" query in the tree.
-
remove
public static QueryTreeAction remove()
remove the current node
-
getAction
public QueryTreeAction.Action getAction()
-
getReplacement
public Query getReplacement()
- Returns:
- null unless action = REPLACE
-
-