Class JoinQuery
- 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.JoinQuery
 
 
 
 
- 
 public class JoinQuery extends Query A query which joins or traces relationships between documents A query ("query") identifies preliminary or seed matches. The "from" field values in all of these matches are brought together into a set. The query then returns all documents whose "to" field contains a value from this set.The semantics mirror that of a SQL "nested query" of the form: SELECT ... FROM ... WHERE $to IN (SELECT $from FROM ... WHERE $query)In select circumstances, JoinQuery supports running the subquery on a separate collection. In these cases this collection can be specified using "fromIndex". 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringTYPE
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description JoinQueryclone()java.util.List<Query>getChildQueries()Returns all the children of the query in question.java.lang.StringgetFrom()java.lang.StringgetFromIndex()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- 
JoinQuerypublic JoinQuery(java.lang.String from, java.lang.String to, java.lang.String fromIndex, Query query)
 
- 
 - 
Method Detail- 
getTopublic java.lang.String getTo() - Returns:
- the field name compared against the set of "from" field values. The overall result set contains documents whose "to" field contains any of the values in the "from" field of subquery matches.
 
 - 
getFrompublic java.lang.String getFrom() - Returns:
- the field name containing the values of interest in the subquery matches. All values in this field matched by the subquery are gathered into a set and used to identify the documents matching the overall query
 
 - 
getFromIndexpublic java.lang.String getFromIndex() - Returns:
- a separate collection to run the subquery on. This option is only supported conditionally based on backend- specific requirements. If not specified, the subquery is run on the same collection that the "to" values are gathered in.
 
 - 
getQuerypublic Query getQuery() - Returns:
- the subquery used to identify the documents whose "from" field values are of interest.
 
 - 
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.
 
 
- 
 
-