@Override public void indexSpellCheckerDictionary(SearchContext searchContext) throws SearchException { try { indexKeywords( searchContext, searchContext.getLanguageId(), PropsKeys.INDEX_SEARCH_SPELL_CHECKER_DICTIONARY, Field.SPELL_CHECK_WORD, SuggestionConstants.TYPE_SPELL_CHECKER, 0); } catch (Exception e) { throw new SearchException(e); } }
@Override public void indexQuerySuggestionDictionary(SearchContext searchContext) throws SearchException { try { indexKeywords( searchContext, searchContext.getLanguageId(), PropsKeys.INDEX_SEARCH_QUERY_SUGGESTION_DICTIONARY, Field.KEYWORD_SEARCH, SuggestionConstants.TYPE_QUERY_SUGGESTION, _querySuggestionMaxNGramLength); } catch (Exception e) { throw new SearchException(e); } }
@Override public String spellCheckKeywords(SearchContext searchContext) throws SearchException { Map<String, List<String>> suggestions = spellCheckKeywords( searchContext, 1); String localizedFieldName = Field.getLocalizedName( searchContext.getLanguageId(), Field.SPELL_CHECK_WORD); List<String> keywords = TokenizerUtil.tokenize( localizedFieldName, searchContext.getKeywords(), searchContext.getLanguageId()); return CollatorUtil.collate(suggestions, keywords); }
searchContext, groupId, searchContext.getLanguageId(), searchContext.getKeywords(), weight, keywordFieldName, typeFieldValue, maxNGramLength);
@Override public void indexQuerySuggestionDictionary(SearchContext searchContext) throws SearchException { try { indexKeywords( searchContext, searchContext.getLanguageId(), PropsKeys.INDEX_SEARCH_QUERY_SUGGESTION_DICTIONARY, Field.KEYWORD_SEARCH, SuggestionConstants.TYPE_QUERY_SUGGESTION, _querySuggestionMaxNGramLength); } catch (Exception e) { throw new SearchException(e); } }
@Override public void indexSpellCheckerDictionary(SearchContext searchContext) throws SearchException { try { indexKeywords( searchContext, searchContext.getLanguageId(), PropsKeys.INDEX_SEARCH_SPELL_CHECKER_DICTIONARY, Field.SPELL_CHECK_WORD, SuggestionConstants.TYPE_SPELL_CHECKER, 0); } catch (Exception e) { throw new SearchException(e); } }
searchContext, groupId, searchContext.getLanguageId(), searchContext.getKeywords(), weight, keywordFieldName, typeFieldValue, maxNGramLength);