Class TypeAheadKeywordPostProcessor.KeywordContainer
- java.lang.Object
-
- com.broadleafcommerce.search.provider.solr.typeahead.postprocessors.TypeAheadKeywordPostProcessor.KeywordContainer
-
- Enclosing class:
- TypeAheadKeywordPostProcessor
protected static class TypeAheadKeywordPostProcessor.KeywordContainer extends Object
Class holding potential suggestions. Used to differentiate potential multi-term suggestions by terms that occur before and after the highlighted terms, as priority is given to terms that occur after the highlighted string.Preserves case of strings added and does not allow duplicates (ignores case).
-
-
Constructor Summary
Constructors Constructor Description KeywordContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addKeyword(String rawTerm, String highlightTerm)
void
addSecondary(String rawTerm, String highlightTerm)
List<String>
getAllKeywords()
List<String>
getKeywords()
protected boolean
shouldAdd(String term)
Checks if: 1.int
size()
-
-
-
Method Detail
-
size
public int size()
-
getAllKeywords
public List<String> getAllKeywords()
- Returns:
- All keywords with higher priority terms occurring earlier in the list.
-
shouldAdd
protected boolean shouldAdd(String term)
Checks if:-
1. The exact term already exists
-
2. A plural form (ends with s) has already been added
- Parameters:
term
- The term to check- Returns:
- true if should be added, else false.
-
-