Class SearchResponse
java.lang.Object
com.broadleafcommerce.search.api.domain.PagedModel<Object>
com.broadleafcommerce.search.api.domain.SearchResponse
Represents the results from a search.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.broadleafcommerce.search.api.domain.PagedModel
PagedModel.PageMetadata
-
Constructor Summary
ConstructorsConstructorDescriptionSearchResponse
(List<Object> content, org.springframework.data.domain.Pageable pageable, long total) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The facets returned in the search result.A redirect generated based on the original request query.getSorts()
The sort options returned in the search result.Set if spellcheck returned any results.int
hashCode()
boolean
If no results were found and a different query was executed than the original, this is set to true.void
setCorrectedQuery
(boolean correctedQuery) If no results were found and a different query was executed than the original, this is set to true.void
setFacets
(List<FacetResponse> facets) The facets returned in the search result.void
setRedirect
(SearchRedirectResponse redirect) A redirect generated based on the original request query.void
setSorts
(List<SortResponse> sorts) The sort options returned in the search result.void
setSpellCheckResult
(SpellCheckResult spellCheckResult) Set if spellcheck returned any results.toString()
Methods inherited from class com.broadleafcommerce.search.api.domain.PagedModel
getContent, getMetadata, getNumber, getNumberOfElements, getSize, getTotalElements, getTotalPages, isEmpty, isFirst, isLast
-
Constructor Details
-
SearchResponse
-
-
Method Details
-
getFacets
The facets returned in the search result.- Returns:
- facets returned in the search result
-
getSorts
The sort options returned in the search result.- Returns:
- sort options returned in the search result
-
getRedirect
A redirect generated based on the original request query.If present, the rest of the response will be empty.
- Returns:
- redirect to perform in place of search results
-
isCorrectedQuery
public boolean isCorrectedQuery()If no results were found and a different query was executed than the original, this is set to true.- Returns:
- whether this response is for a different corrected query
-
getSpellCheckResult
Set if spellcheck returned any results. Contains the original query and any potential suggestions.- Returns:
- spell check results and suggestions
-
setFacets
The facets returned in the search result.- Parameters:
facets
- facets returned in the search result
-
setSorts
The sort options returned in the search result.- Parameters:
sorts
- sort options returned in the search result
-
setRedirect
A redirect generated based on the original request query.If present, the rest of the response will be empty.
- Parameters:
redirect
- redirect to perform in place of search results
-
setCorrectedQuery
public void setCorrectedQuery(boolean correctedQuery) If no results were found and a different query was executed than the original, this is set to true.- Parameters:
correctedQuery
- whether this response is for a different corrected query
-
setSpellCheckResult
Set if spellcheck returned any results. Contains the original query and any potential suggestions.- Parameters:
spellCheckResult
- spell check results and suggestions
-
toString
-
equals
- Overrides:
equals
in classPagedModel<Object>
-
canEqual
-
hashCode
public int hashCode()- Overrides:
hashCode
in classPagedModel<Object>
-