Class CompoundQuery
- 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.CompoundQuery
 
 
 
 
- 
 public class CompoundQuery extends Query A multi-clause query that merges the result sets of independent subqueriesCompoundQuerywraps an arbitrary number of subqueries. Each clause is specified as a "must", "mustNot", or "should" - indicating how the subquery result set impacts the result set of the compound whole.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classCompoundQuery.Operator
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringTYPE
 - 
Constructor SummaryConstructors Constructor Description CompoundQuery(java.lang.String minimumNumberShouldMatch, java.util.List<Query> must, java.util.List<Query> should, java.util.List<Query> mustNot, java.util.List<MinimumMatch> minimumMatch)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CompoundQueryclone()java.util.List<Query>getChildQueries()Returns all the children of the query in question.java.util.List<MinimumMatch>getMinimumMatch()java.lang.StringgetMinimumNumberShouldMatch()Deprecated.java.util.List<Query>getMust()java.util.List<Query>getMustNot()java.util.List<Query>getShould()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.voidsetMinimumMatch(java.util.List<MinimumMatch> minimumMatch)voidsetMinimumNumberShouldMatch(java.lang.String minimumNumberShouldMatch)Deprecated.- 
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- 
CompoundQuerypublic CompoundQuery(java.lang.String minimumNumberShouldMatch, java.util.List<Query> must, java.util.List<Query> should, java.util.List<Query> mustNot, java.util.List<MinimumMatch> minimumMatch)
 
- 
 - 
Method Detail- 
getMinimumNumberShouldMatch@Deprecated public java.lang.String getMinimumNumberShouldMatch() Deprecated.
 - 
setMinimumNumberShouldMatch@Deprecated public void setMinimumNumberShouldMatch(java.lang.String minimumNumberShouldMatch) Deprecated.
 - 
getMustpublic java.util.List<Query> getMust() - Returns:
- query clauses which need to be matched in order for a document to match the overall CompoundQuery
 
 - 
getShouldpublic java.util.List<Query> getShould() - Returns:
- query clauses which are preferable but not strictly required to match the overall CompoundQuery.
 When "must" clauses are present, "should" clauses primarily affect scoring (and as a result, default sorting). When "must" clauses are absent but "should" clauses are present, documents must match at least one "should" clause to be included in the overall result set. 
 
 - 
getMustNotpublic java.util.List<Query> getMustNot() - Returns:
- query clauses which disqualify documents from matching the overall CompoundQuery.  Matching a single
 "mustNot" clause removes the document in question from the overall result set.
 If a CompoundQuery contains only "mustNot" queries, the overall results are computed as if a "must" MatchAllQuerywas specified.
 
 - 
getMinimumMatchpublic java.util.List<MinimumMatch> getMinimumMatch() 
 - 
setMinimumMatchpublic void setMinimumMatch(java.util.List<MinimumMatch> minimumMatch) 
 - 
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 CompoundQuery clone() 
 
- 
 
-