Class QueryTreeWalker
- java.lang.Object
- 
- com.lucidworks.search.dsl.DslBase
- 
- com.lucidworks.search.dsl.request.query.walk.QueryTreeWalker
 
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classQueryTreeWalker.QueryWalkContext
 - 
Constructor SummaryConstructors Constructor Description QueryTreeWalker()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.stream.Stream<QueryTreeWalker.QueryWalkContext>contextStream(QueryDefinition qd)Creates a stream populated by a depth-first walk of the query-tree Callers should beware using theQueryTreeWalker.QueryWalkContextto modify the links between queries as tree branches may be orphaned or dropped from iteration as a result.voiddepthFirstWalk(QueryDefinition queryDefinition, java.util.function.Function<QueryTreeWalker.QueryWalkContext,QueryTreeAction> perNodeAction)Performs a depth-first walk of the main query in the specifiedQueryDefinitionOur walk processes the whole tree by default.
 
- 
- 
- 
Method Detail- 
depthFirstWalkpublic void depthFirstWalk(QueryDefinition queryDefinition, java.util.function.Function<QueryTreeWalker.QueryWalkContext,QueryTreeAction> perNodeAction) Performs a depth-first walk of the main query in the specifiedQueryDefinitionOur walk processes the whole tree by default. However, if the provided callback replaces the Query currently being processed, the walk skips over any children in that subtree to limit the risk of accidental infinite-recursion or double-visiting.- Parameters:
- queryDefinition- the DSL definition containing the query-tree to walk
- perNodeAction- a Function to process each node as it's visited. If any modifications are being made to the node (or its children), the Function can return a new query object which should replace the current query's position within the tree. Function's that don't modify the tree in any way can return the Query object attached to the current QueryWalkContext
 
 - 
contextStreampublic static java.util.stream.Stream<QueryTreeWalker.QueryWalkContext> contextStream(QueryDefinition qd) Creates a stream populated by a depth-first walk of the query-tree Callers should beware using theQueryTreeWalker.QueryWalkContextto modify the links between queries as tree branches may be orphaned or dropped from iteration as a result.
 
- 
 
-