Class BasicLuceneSuggestionsSearcher

All Implemented Interfaces:
BusinessObject, BusinessProcessor, LuceneSearcher, LuceneSuggestionsSearcher

public class BasicLuceneSuggestionsSearcher extends BasicLuceneSearcher implements LuceneSuggestionsSearcher
Class responsible for searching on the Lucene Suggestions Index to provide suggestions to help users search.
Author:
David Tobey
  • Field Details

    • log

      static org.apache.commons.logging.Log log
  • Constructor Details

    • BasicLuceneSuggestionsSearcher

      public BasicLuceneSuggestionsSearcher()
  • Method Details

    • searchSuggestions

      public Collection searchSuggestions(String indexDir, String searchString) throws Exception
      Specified by:
      searchSuggestions in interface LuceneSuggestionsSearcher
      Throws:
      Exception
    • searchAndCompileSuggestions

      protected Collection searchAndCompileSuggestions(String searchString) throws Exception
      Throws:
      Exception
    • searchForSuggestionDocuments

      protected org.apache.lucene.search.TopDocs searchForSuggestionDocuments(String searchString) throws Exception
      Throws:
      Exception
    • makeSearchStringWildcardAndFuzzy

      protected String makeSearchStringWildcardAndFuzzy(String searchString, String advancedSearchSuggestionsMatchStyle, String advancedSearchSuggestionsFuzziness) throws Exception
      Throws:
      Exception
    • determineSuggestionsQuery

      protected org.apache.lucene.search.Query determineSuggestionsQuery(String searchString, String advancedSearchSuggestionsMatchStyle, String advancedSearchSuggestionsFuzziness) throws Exception
      Throws:
      Exception
    • createSuggestionsParserUsingDefaults

      protected org.apache.lucene.queryParser.QueryParser createSuggestionsParserUsingDefaults(String searchString, String field, String advancedSearchSuggestionsMatchStyle, String advancedSearchSuggestionsFuzziness) throws Exception
      Throws:
      Exception
    • createSuggestionsParser

      protected org.apache.lucene.queryParser.QueryParser createSuggestionsParser(String searchString, String field, org.apache.lucene.analysis.Analyzer analyzer, String advancedSearchSuggestionsMatchStyle, String advancedSearchSuggestionsFuzziness) throws Exception
      Throws:
      Exception
    • determineSuggestionsSort

      protected org.apache.lucene.search.Sort determineSuggestionsSort()
    • performSuggestionsSearch

      protected org.apache.lucene.search.TopDocs performSuggestionsSearch(org.apache.lucene.search.Query mainQuery, int numberOfItems, org.apache.lucene.search.Sort sort) throws Exception
      Throws:
      Exception
    • compileSuggestionsFromHits

      protected Collection compileSuggestionsFromHits(org.apache.lucene.search.TopDocs hits) throws Exception
      Throws:
      Exception