Class SpellCheckResult
- java.lang.Object
-
- com.broadleafcommerce.search.api.domain.SpellCheckResult
-
- All Implemented Interfaces:
Serializable
public class SpellCheckResult extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpellCheckResult.SuggestedQuery
-
Constructor Summary
Constructors Constructor Description SpellCheckResult(String originalQuery)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddQuerySuggestion(String suggestedQuery, long numberOfHits)Add a suggested query replacement.voidaddSpellSuggestion(String incorrectWord, List<String> wordSuggestions, int startOffset, int endOffset)Add a new spell check suggestion to the results.protected booleancanEqual(Object other)booleanequals(Object o)StringgetOriginalQuery()The original search query.List<SpellCheckResult.SuggestedQuery>getSuggestedQueries()The suggested queries after spell correction, in order of most to least recommended.Map<String,SpellCheckSuggestion>getSuggestionMap()Suggested spelling corrections of the original query to retrieve results.Collection<SpellCheckSuggestion>getSuggestions()Get all of the spell check suggestions.StringgetTopSuggestionQuery()Get the best suggested query based on the number of hits.inthashCode()voidsetOriginalQuery(String originalQuery)The original search query.voidsetSuggestedQueries(List<SpellCheckResult.SuggestedQuery> suggestedQueries)The suggested queries after spell correction, in order of most to least recommended.voidsetSuggestionMap(Map<String,SpellCheckSuggestion> suggestionMap)Suggested spelling corrections of the original query to retrieve results.StringtoString()
-
-
-
Constructor Detail
-
SpellCheckResult
public SpellCheckResult(String originalQuery)
-
-
Method Detail
-
addSpellSuggestion
public void addSpellSuggestion(String incorrectWord, List<String> wordSuggestions, int startOffset, int endOffset)
Add a new spell check suggestion to the results.- Parameters:
incorrectWord- the word to suggest a replacement forwordSuggestions- the suggested replacement wordsstartOffset- the starting index of the incorrect wordendOffset- the end index of the incorrect word
-
addQuerySuggestion
public void addQuerySuggestion(String suggestedQuery, long numberOfHits)
Add a suggested query replacement.- Parameters:
suggestedQuery- the suggested replacement querynumberOfHits- the number of hits for the suggested query
-
getTopSuggestionQuery
@Nullable public String getTopSuggestionQuery()
Get the best suggested query based on the number of hits.- Returns:
- best suggested query
-
getSuggestions
public Collection<SpellCheckSuggestion> getSuggestions()
Get all of the spell check suggestions.- Returns:
- all spell check suggestions
-
getOriginalQuery
public String getOriginalQuery()
The original search query.- Returns:
- original search query
-
getSuggestedQueries
public List<SpellCheckResult.SuggestedQuery> getSuggestedQueries()
The suggested queries after spell correction, in order of most to least recommended.- Returns:
- suggested queries after spell correction
-
getSuggestionMap
public Map<String,SpellCheckSuggestion> getSuggestionMap()
Suggested spelling corrections of the original query to retrieve results.- Returns:
- suggested spelling corrections
-
setOriginalQuery
public void setOriginalQuery(String originalQuery)
The original search query.- Parameters:
originalQuery- original search query
-
setSuggestedQueries
public void setSuggestedQueries(List<SpellCheckResult.SuggestedQuery> suggestedQueries)
The suggested queries after spell correction, in order of most to least recommended.- Parameters:
suggestedQueries- suggested queries after spell correction
-
setSuggestionMap
public void setSuggestionMap(Map<String,SpellCheckSuggestion> suggestionMap)
Suggested spelling corrections of the original query to retrieve results.- Parameters:
suggestionMap- suggested spelling corrections
-
canEqual
protected boolean canEqual(Object other)
-
-