Class SpellCheckResult
java.lang.Object
com.broadleafcommerce.search.api.domain.SpellCheckResult
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addQuerySuggestion
(String suggestedQuery, long numberOfHits) Add a suggested query replacement.void
addSpellSuggestion
(String incorrectWord, List<String> wordSuggestions, int startOffset, int endOffset) Add a new spell check suggestion to the results.protected boolean
boolean
The original search query.The suggested queries after spell correction, in order of most to least recommended.Suggested spelling corrections of the original query to retrieve results.Get all of the spell check suggestions.Get the best suggested query based on the number of hits.int
hashCode()
void
setOriginalQuery
(String originalQuery) The original search query.void
setSuggestedQueries
(List<SpellCheckResult.SuggestedQuery> suggestedQueries) The suggested queries after spell correction, in order of most to least recommended.void
setSuggestionMap
(Map<String, SpellCheckSuggestion> suggestionMap) Suggested spelling corrections of the original query to retrieve results.toString()
-
Constructor Details
-
SpellCheckResult
-
-
Method Details
-
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
Add a suggested query replacement.- Parameters:
suggestedQuery
- the suggested replacement querynumberOfHits
- the number of hits for the suggested query
-
getTopSuggestionQuery
Get the best suggested query based on the number of hits.- Returns:
- best suggested query
-
getSuggestions
Get all of the spell check suggestions.- Returns:
- all spell check suggestions
-
getOriginalQuery
The original search query.- Returns:
- original search query
-
getSuggestedQueries
The suggested queries after spell correction, in order of most to least recommended.- Returns:
- suggested queries after spell correction
-
getSuggestionMap
Suggested spelling corrections of the original query to retrieve results.- Returns:
- suggested spelling corrections
-
setOriginalQuery
The original search query.- Parameters:
originalQuery
- original search query
-
setSuggestedQueries
The suggested queries after spell correction, in order of most to least recommended.- Parameters:
suggestedQueries
- suggested queries after spell correction
-
setSuggestionMap
Suggested spelling corrections of the original query to retrieve results.- Parameters:
suggestionMap
- suggested spelling corrections
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-