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 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 if spellCheckEnabled 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 if spellCheckQuery 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 if spellCheckEnabled is 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 if spellCheckQuery is false.
      Default is 1.
      Returns:
      number of suggested queries to return
    • isShowSuggestionQueryHitCount

      public boolean isShowSuggestionQueryHitCount()
      If true, returns number of hits for suggested queries. If autoCorrectQuery is enabled this should likely be disabled, though suggested queries and their hit counts will still be returned.
      See suggestionQueryCollationTries for performance considerations when enabling this property.

      Ignored if spellCheckQuery 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 if showSuggestionQueryHitCount 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 if spellCheckEnabled 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 if spellCheckQuery 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 if spellCheckEnabled is 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 if spellCheckQuery is 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. If autoCorrectQuery is enabled this should likely be disabled, though suggested queries and their hit counts will still be returned.
      See suggestionQueryCollationTries for performance considerations when enabling this property.

      Ignored if spellCheckQuery 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 if showSuggestionQueryHitCount is false.
      Default is 1
      Parameters:
      suggestionQueryCollationTries - number of suggestion queries to return the number of hits for
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object