Class IndexableSpellCheckProperties
- java.lang.Object
-
- com.broadleafcommerce.search.core.spellcheck.IndexableSpellCheckProperties
-
public class IndexableSpellCheckProperties extends Object
The properties controlling enabling/disabling spell check, suggestions, auto query correction, and related options for a specific indexable type.
-
-
Constructor Summary
Constructors Constructor Description IndexableSpellCheckProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
int
getSuggestedQueryCount()
The number of suggested queries to return.int
getSuggestionCount()
The number of spelling suggestions to return in a search response.int
getSuggestionQueryCollationTries()
Approximately the number of suggestion queries to return the number of hits for.int
hashCode()
boolean
isAutoCorrectQuery()
Enables/disables auto-correction of queries.boolean
isShowSuggestionQueryHitCount()
If true, returns number of hits for suggested queries.boolean
isSpellCheckEnabled()
Enables/disables spellcheck.boolean
isSpellCheckQuery()
If true, returns a spellcheck corrected query in a search response.void
setAutoCorrectQuery(boolean autoCorrectQuery)
Enables/disables auto-correction of queries.void
setShowSuggestionQueryHitCount(boolean showSuggestionQueryHitCount)
If true, returns number of hits for suggested queries.void
setSpellCheckEnabled(boolean spellCheckEnabled)
Enables/disables spellcheck.void
setSpellCheckQuery(boolean spellCheckQuery)
If true, returns a spellcheck corrected query in a search response.void
setSuggestedQueryCount(int suggestedQueryCount)
The number of suggested queries to return.void
setSuggestionCount(int suggestionCount)
The number of spelling suggestions to return in a search response.void
setSuggestionQueryCollationTries(int suggestionQueryCollationTries)
Approximately the number of suggestion queries to return the number of hits for.String
toString()
-
-
-
Method Detail
-
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 ifspellCheckEnabled
is 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 ifspellCheckQuery
is 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 ifspellCheckEnabled
is false. Default is 1- Returns:
- number of spelling suggestions to return in a search response
-
getSuggestedQueryCount
public int getSuggestedQueryCount()
- Returns:
- number of suggested queries to return
-
isShowSuggestionQueryHitCount
public boolean isShowSuggestionQueryHitCount()
If true, returns number of hits for suggested queries. IfautoCorrectQuery
is enabled this should likely be disabled, though suggested queries and their hit counts will still be returned.
SeesuggestionQueryCollationTries
for performance considerations when enabling this property.
Ignored ifspellCheckQuery
is 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 ifshowSuggestionQueryHitCount
is 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 ifspellCheckEnabled
is 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 ifspellCheckQuery
is 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 ifspellCheckEnabled
is false. Default is 1- Parameters:
suggestionCount
- number of spelling suggestions to return in a search response
-
setSuggestedQueryCount
public void setSuggestedQueryCount(int suggestedQueryCount)
- Parameters:
suggestedQueryCount
- number of suggested queries to return
-
setShowSuggestionQueryHitCount
public void setShowSuggestionQueryHitCount(boolean showSuggestionQueryHitCount)
If true, returns number of hits for suggested queries. IfautoCorrectQuery
is enabled this should likely be disabled, though suggested queries and their hit counts will still be returned.
SeesuggestionQueryCollationTries
for performance considerations when enabling this property.
Ignored ifspellCheckQuery
is 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 ifshowSuggestionQueryHitCount
is false.
Default is 1- Parameters:
suggestionQueryCollationTries
- number of suggestion queries to return the number of hits for
-
canEqual
protected boolean canEqual(Object other)
-
-