Class SearchRequest
- java.lang.Object
-
- com.broadleafcommerce.search.api.domain.SearchRequest
-
public class SearchRequest extends Object
Represents the request for a query to be searched.
-
-
Constructor Summary
Constructors Constructor Description SearchRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
Boolean
getAutoCorrectQuery()
Optional.Boolean
getEnableSpellCheck()
Optional.List<Filter>
getFilters()
The list of filters to apply to this query.String
getQuery()
The raw search query.RuleFilter
getRuleFilters()
Additional rule-based RSQL filters to apply to this query.IndexableType
getType()
TheIndexableType
for this query.int
hashCode()
boolean
isDebug()
If set to true, a string containing debug information about the query results will be returned.boolean
isSpellCheckedQuery()
This is set to true if this query has already been run once to avoid unnecessarily spellchecking the query a second time.void
setAutoCorrectQuery(Boolean autoCorrectQuery)
Optional.void
setDebug(boolean debug)
If set to true, a string containing debug information about the query results will be returned.void
setEnableSpellCheck(Boolean enableSpellCheck)
Optional.void
setFilters(List<Filter> filters)
The list of filters to apply to this query.void
setQuery(String query)
The raw search query.void
setRuleFilters(RuleFilter ruleFilters)
Additional rule-based RSQL filters to apply to this query.void
setSpellCheckedQuery(boolean spellCheckedQuery)
This is set to true if this query has already been run once to avoid unnecessarily spellchecking the query a second time.void
setType(IndexableType type)
TheIndexableType
for this query.String
toString()
-
-
-
Method Detail
-
getQuery
@Nullable public String getQuery()
The raw search query.- Returns:
- The raw search query
-
getType
public IndexableType getType()
TheIndexableType
for this query.- Returns:
- The type for this query
-
getFilters
public List<Filter> getFilters()
The list of filters to apply to this query.- Returns:
- The list of filters to apply to this query
-
getRuleFilters
public RuleFilter getRuleFilters()
Additional rule-based RSQL filters to apply to this query.- Returns:
- RSQL filters to apply to this query
-
getEnableSpellCheck
@Nullable public Boolean getEnableSpellCheck()
Optional.
Overrides default setting for spellcheck.
Set to false to disable spellcheck. This completely disables spellcheck, so also affects automatic query correction.- Returns:
- whether spell check should be enabled for this request
- See Also:
SearchResponse.getSpellCheckResult()
,SpellCheckResult
-
getAutoCorrectQuery
@Nullable public Boolean getAutoCorrectQuery()
Optional.
Overrides default setting for automatic query correction.
If set to true, if no query results are found on the original query and a spelling correction is available, another query will be performed automatically- Returns:
- whether auto-correct querying should be enabled for this request
- See Also:
enableSpellCheck
,SearchResponse.isCorrectedQuery()
-
isSpellCheckedQuery
public boolean isSpellCheckedQuery()
This is set to true if this query has already been run once to avoid unnecessarily spellchecking the query a second time.- Returns:
- whether this query has already been spell checked
-
isDebug
public boolean isDebug()
If set to true, a string containing debug information about the query results will be returned.- Returns:
- whether debug information should be returned
-
setQuery
public void setQuery(@Nullable String query)
The raw search query.- Parameters:
query
- The raw search query
-
setType
public void setType(IndexableType type)
TheIndexableType
for this query.- Parameters:
type
- The type for this query
-
setFilters
public void setFilters(List<Filter> filters)
The list of filters to apply to this query.- Parameters:
filters
- The list of filters to apply to this query
-
setRuleFilters
public void setRuleFilters(RuleFilter ruleFilters)
Additional rule-based RSQL filters to apply to this query.- Parameters:
ruleFilters
- RSQL filters to apply to this query
-
setEnableSpellCheck
public void setEnableSpellCheck(@Nullable Boolean enableSpellCheck)
Optional.
Overrides default setting for spellcheck.
Set to false to disable spellcheck. This completely disables spellcheck, so also affects automatic query correction.- Parameters:
enableSpellCheck
- whether spell check should be enabled for this request- See Also:
SearchResponse.getSpellCheckResult()
,SpellCheckResult
-
setAutoCorrectQuery
public void setAutoCorrectQuery(@Nullable Boolean autoCorrectQuery)
Optional.
Overrides default setting for automatic query correction.
If set to true, if no query results are found on the original query and a spelling correction is available, another query will be performed automatically- Parameters:
enableSpellCheck
- whether auto-correct querying should be enabled for this request- See Also:
enableSpellCheck
,SearchResponse.isCorrectedQuery()
-
setSpellCheckedQuery
public void setSpellCheckedQuery(boolean spellCheckedQuery)
This is set to true if this query has already been run once to avoid unnecessarily spellchecking the query a second time.- Parameters:
spellCheckedQuery
- whether this query has already been spell checked
-
setDebug
public void setDebug(boolean debug)
If set to true, a string containing debug information about the query results will be returned.- Parameters:
debug
- whether debug information should be returned
-
canEqual
protected boolean canEqual(Object other)
-
-