Class GraphQuery
- java.lang.Object
- 
- com.lucidworks.search.dsl.DslBase
- 
- com.lucidworks.search.dsl.request.DslCloneable
- 
- com.lucidworks.search.dsl.request.query.Query
- 
- com.lucidworks.search.dsl.request.query.GraphQuery
 
 
 
 
- 
 public class GraphQuery extends Query A query to traverse graph-like relationships in indexed data. Use of this query assumes your data is setup to represent a directed graph. Each document represents a node in the graph and its connecting edges: the "from" field holds an identifier for the node itself, with outgoing edges represented by the node IDs held in the "to" field. The starting points or seeds for the traversal are identified by the result set of the provided subquery. The result set of this query contains all documents/nodes reachable via graph traversal from the provided seeds.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringTYPE
 - 
Constructor SummaryConstructors Constructor Description GraphQuery(java.lang.String from, java.lang.String to, Query query)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphQueryclone()java.util.List<Query>getChildQueries()Returns all the children of the query in question.java.lang.StringgetFrom()QuerygetQuery()java.lang.StringgetTo()booleanisEmptyQuery()booleanremoveChildQuery(Query toRemove)Remove 'toRemove', if 'toRemove' is currently a child of this Query object.booleanreplaceChildQuery(Query toReplace, Query replacement)Swap 'replacement' in as a replacement, if 'toReplace' is currently a child of this Query object.- 
Methods inherited from class com.lucidworks.search.dsl.request.DslCloneableclone, deepClone
 
- 
 
- 
- 
- 
Field Detail- 
TYPEpublic static final java.lang.String TYPE - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
GraphQuerypublic GraphQuery(java.lang.String from, java.lang.String to, Query query)
 
- 
 - 
Method Detail- 
getTopublic java.lang.String getTo() - Returns:
- the field name that holds each document's outgoing edges. The values in this field should match values held by the "from" field in other documents.
 
 - 
getFrompublic java.lang.String getFrom() - Returns:
- the field name that holds an identifier for each document/node in the graph.
 
 - 
getQuerypublic Query getQuery() - Returns:
- a query whose result set documents are used as seeds for the graph traversal.
 
 - 
getChildQueriespublic java.util.List<Query> getChildQueries() Description copied from class:QueryReturns all the children of the query in question. The returnedListis provided as a copy - changes made to it do not impact the originating Query object in any way.- Specified by:
- getChildQueriesin class- Query
 
 - 
replaceChildQuerypublic boolean replaceChildQuery(Query toReplace, Query replacement) Description copied from class:QuerySwap 'replacement' in as a replacement, if 'toReplace' is currently a child of this Query object. Because a tree of Query objects might conceivably have repeated clauses, this method is implemented to test 'toReplace' using reference-equality instead of value-equality.- Specified by:
- replaceChildQueryin class- Query
- Returns:
- true if a replacement was made, false otherwise.
 
 - 
removeChildQuerypublic boolean removeChildQuery(Query toRemove) Description copied from class:QueryRemove 'toRemove', if 'toRemove' is currently a child of this Query object. Because a tree of Query objects might conceivably have repeated clauses, this method is implemented to test 'toRemove' using reference-equality instead of value-equality.- Specified by:
- removeChildQueryin class- Query
- Returns:
- true if a removal was made, false otherwise.
 
 - 
isEmptyQuerypublic boolean isEmptyQuery() - Specified by:
- isEmptyQueryin class- Query
- Returns:
- true if this query is now essentially "empty" (doesn't affect query logic at all) and can now be removed from the query tree. This can happen, for example, if all child queries were removed and the query logic depends on having at least one child query.
 
 - 
clonepublic GraphQuery clone() 
 
- 
 
-