Class IndexableSpellCheckProperties
java.lang.Object
com.broadleafcommerce.search.core.spellcheck.IndexableSpellCheckProperties
The properties controlling enabling/disabling spell check, suggestions, auto query correction,
and related options for a specific indexable type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanintThe number of suggested queries to return.intThe number of spelling suggestions to return in a search response.intApproximately the number of suggestion queries to return the number of hits for.inthashCode()booleanEnables/disables auto-correction of queries.booleanIf true, returns number of hits for suggested queries.booleanEnables/disables spellcheck.booleanIf true, returns a spellcheck corrected query in a search response.voidsetAutoCorrectQuery(boolean autoCorrectQuery) Enables/disables auto-correction of queries.voidsetShowSuggestionQueryHitCount(boolean showSuggestionQueryHitCount) If true, returns number of hits for suggested queries.voidsetSpellCheckEnabled(boolean spellCheckEnabled) Enables/disables spellcheck.voidsetSpellCheckQuery(boolean spellCheckQuery) If true, returns a spellcheck corrected query in a search response.voidsetSuggestedQueryCount(int suggestedQueryCount) The number of suggested queries to return.voidsetSuggestionCount(int suggestionCount) The number of spelling suggestions to return in a search response.voidsetSuggestionQueryCollationTries(int suggestionQueryCollationTries) Approximately the number of suggestion queries to return the number of hits for.toString()
-
Constructor Details
-
IndexableSpellCheckProperties
public IndexableSpellCheckProperties()
-
-
Method Details
-
isSpellCheckEnabled
public boolean isSpellCheckEnabled()Enables/disables spellcheck.
If this is set to false, all other spell check properties are ignored.
Default is true- Returns:
- whether spell check is enabled
-
isSpellCheckQuery
public boolean isSpellCheckQuery()If true, returns a spellcheck corrected query in a search response.
Ignored ifspellCheckEnabledis false.
Default is true- Returns:
- whether to return a spellcheck corrected query in a search response
-
isAutoCorrectQuery
public boolean isAutoCorrectQuery()Enables/disables auto-correction of queries. If zero search results are found and a suggested query is returned, a search is re-run with the revised query automatically.
Ignored ifspellCheckQueryis false.
Default is false- Returns:
- whether to auto-correct and query for empty results
-
getSuggestionCount
public int getSuggestionCount()The number of spelling suggestions to return in a search response.
Ignored ifspellCheckEnabledis false. Default is 1- Returns:
- number of spelling suggestions to return in a search response
-
getSuggestedQueryCount
public int getSuggestedQueryCount()The number of suggested queries to return.
Ignored ifspellCheckQueryis false.
Default is 1.- Returns:
- number of suggested queries to return
-
isShowSuggestionQueryHitCount
public boolean isShowSuggestionQueryHitCount()If true, returns number of hits for suggested queries. IfautoCorrectQueryis enabled this should likely be disabled, though suggested queries and their hit counts will still be returned.
SeesuggestionQueryCollationTriesfor performance considerations when enabling this property.
Ignored ifspellCheckQueryis false.
Default is false- Returns:
- whether to return number of hits for suggested queries
-
getSuggestionQueryCollationTries
public int getSuggestionQueryCollationTries()Approximately the number of suggestion queries to return the number of hits for. This number is not guaranteed. This is simply the number of tries that will be attempted on suggested queries before giving up.
This property can potentially have a significant impact on performance, as it runs queries to obtain hit counts. This should be a low value (N < 5)
Ignored ifshowSuggestionQueryHitCountis false.
Default is 1- Returns:
- number of suggestion queries to return the number of hits for
-
setSpellCheckEnabled
public void setSpellCheckEnabled(boolean spellCheckEnabled) Enables/disables spellcheck.
If this is set to false, all other spell check properties are ignored.
Default is true- Parameters:
spellCheckEnabled- whether spell check is enabled
-
setSpellCheckQuery
public void setSpellCheckQuery(boolean spellCheckQuery) If true, returns a spellcheck corrected query in a search response.
Ignored ifspellCheckEnabledis false.
Default is true- Parameters:
spellCheckQuery- whether to return a spellcheck corrected query in a search response
-
setAutoCorrectQuery
public void setAutoCorrectQuery(boolean autoCorrectQuery) Enables/disables auto-correction of queries. If zero search results are found and a suggested query is returned, a search is re-run with the revised query automatically.
Ignored ifspellCheckQueryis false.
Default is false- Parameters:
autoCorrectQuery- whether to auto-correct and query for empty results
-
setSuggestionCount
public void setSuggestionCount(int suggestionCount) The number of spelling suggestions to return in a search response.
Ignored ifspellCheckEnabledis false. Default is 1- Parameters:
suggestionCount- number of spelling suggestions to return in a search response
-
setSuggestedQueryCount
public void setSuggestedQueryCount(int suggestedQueryCount) The number of suggested queries to return.
Ignored ifspellCheckQueryis false.
Default is 1.- Parameters:
suggestedQueryCount- number of suggested queries to return
-
setShowSuggestionQueryHitCount
public void setShowSuggestionQueryHitCount(boolean showSuggestionQueryHitCount) If true, returns number of hits for suggested queries. IfautoCorrectQueryis enabled this should likely be disabled, though suggested queries and their hit counts will still be returned.
SeesuggestionQueryCollationTriesfor performance considerations when enabling this property.
Ignored ifspellCheckQueryis false.
Default is false- Parameters:
showSuggestionQueryHitCount- whether to return number of hits for suggested queries
-
setSuggestionQueryCollationTries
public void setSuggestionQueryCollationTries(int suggestionQueryCollationTries) Approximately the number of suggestion queries to return the number of hits for. This number is not guaranteed. This is simply the number of tries that will be attempted on suggested queries before giving up.
This property can potentially have a significant impact on performance, as it runs queries to obtain hit counts. This should be a low value (N < 5)
Ignored ifshowSuggestionQueryHitCountis false.
Default is 1- Parameters:
suggestionQueryCollationTries- number of suggestion queries to return the number of hits for
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-