Class TextQuery
- java.lang.Object
- 
 public class TextQuery extends ChangableValueQuery A query allowing search on a text string. The flexibility provided by this query makes it an ideal wrapper for unstructured query terms (such as come from a user-facing search bar).TextQuerysupports several options for controlling how this text is used, most prominently which fields should be searched against and if/how proximity searching should be performed. See individual options for more details.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringTYPE
 - 
Constructor SummaryConstructors Constructor Description TextQuery(java.util.List<KeyAndBoost> fields, java.util.List<KeyAndBoost> phraseFields, java.lang.Integer phraseSlop, java.lang.String minimumShouldMatch, java.util.List<MinimumMatch> minimumMatch, java.lang.Integer queryPhraseSlop, java.lang.String value)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TextQueryclone()java.util.List<KeyAndBoost>getFields()java.util.List<MinimumMatch>getMinimumMatch()java.lang.StringgetMinimumShouldMatch()Deprecated.java.util.List<KeyAndBoost>getPhraseFields()java.lang.IntegergetPhraseSlop()java.lang.IntegergetQueryPhraseSlop()java.lang.StringgetValue()voidsetFields(java.util.List<KeyAndBoost> fields)voidsetMinimumMatch(java.util.List<MinimumMatch> minimumMatch)voidsetValue(java.lang.String value)- 
Methods inherited from class com.lucidworks.search.dsl.request.query.ChangableValueQueryisEmptyQuery
 - 
Methods inherited from class com.lucidworks.search.dsl.request.query.AbstractLeafQuerygetChildQueries, removeChildQuery, replaceChildQuery
 - 
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- 
TextQuerypublic TextQuery(java.util.List<KeyAndBoost> fields, java.util.List<KeyAndBoost> phraseFields, java.lang.Integer phraseSlop, java.lang.String minimumShouldMatch, java.util.List<MinimumMatch> minimumMatch, java.lang.Integer queryPhraseSlop, java.lang.String value) 
 
- 
 - 
Method Detail- 
getFieldspublic java.util.List<KeyAndBoost> getFields() - Returns:
- the fields to search for the supplied text, along with per-field boosts indicating the relative importance of each field.
 
 - 
getPhraseFieldspublic java.util.List<KeyAndBoost> getPhraseFields() - Returns:
- the fields to phrase-search for the supplied text, along with per-field boosts indicating the relative importance of each field.
 
 - 
getMinimumShouldMatch@Deprecated public java.lang.String getMinimumShouldMatch() Deprecated.- Returns:
- an expression signifying how many query terms in getValue()must be present for a document to be considered a match.May be specified as a positive integer (indicating the number of terms in absolute terms), a negative integer (indicating the number of terms relative to the total), a positive percentage (indicating the percent of query terms that must be present), or a negative percentage (indicting the percent of query terms that may be absent). If not specified, assumed default is "1" 
 
 - 
getMinimumMatchpublic java.util.List<MinimumMatch> getMinimumMatch() 
 - 
setMinimumMatchpublic void setMinimumMatch(java.util.List<MinimumMatch> minimumMatch) 
 - 
getPhraseSloppublic java.lang.Integer getPhraseSlop() - Returns:
- the "slop" used when detecting phrase matches for the entire value. Slop is a measure of how flexible phrase searches should be in matching documents - each unit of slop represents a movement of one token relative to another that is needed for a phrase query to match text in an underlying document. The higher the number, the more forgiving phrase searches are.
 
 - 
getQueryPhraseSloppublic java.lang.Integer getQueryPhraseSlop() - Returns:
- the "slop" used when evaluating phrase queries explicitly included in the provided value. (As opposed tophraseSlopwhich designates the slop used for matching the complete query string).
- See Also:
- getPhraseSlop()
 
 - 
setValuepublic void setValue(java.lang.String value) - Specified by:
- setValuein class- ChangableValueQuery
 
 - 
getValuepublic java.lang.String getValue() - Specified by:
- getValuein class- ChangableValueQuery
- Returns:
- a text string containing the query terms to search.
 
 - 
setFieldspublic void setFields(java.util.List<KeyAndBoost> fields) 
 - 
clonepublic TextQuery clone() - Specified by:
- clonein class- ChangableValueQuery
 
 
- 
 
-