Class BasicLuceneSearcher

All Implemented Interfaces:
BusinessObject, BusinessProcessor, LuceneSearcher
Direct Known Subclasses:
BasicLuceneSuggestionsSearcher

public class BasicLuceneSearcher extends BaseLuceneProcessor implements LuceneSearcher
Class responsible for searching on the Lucene index for advanced search functionality.
Author:
Jason McWilliams, David Tobey
  • Field Details

    • log

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

    • BasicLuceneSearcher

      public BasicLuceneSearcher()
  • Method Details

    • getSearchList

      public SearchList getSearchList(SearchList searchList) throws Exception
      Specified by:
      getSearchList in interface LuceneSearcher
      Throws:
      Exception
    • getFacetCounts

      public SearchList getFacetCounts(SearchList searchList) throws Exception
      Specified by:
      getFacetCounts in interface LuceneSearcher
      Throws:
      Exception
    • searchForDocuments

      protected SearchList searchForDocuments(SearchList searchList) throws Exception
      Throws:
      Exception
    • searchProducts

      protected org.apache.lucene.search.TopDocs searchProducts(SearchList searchList) throws Exception
      Throws:
      Exception
    • searchProductsWithinCategory

      protected org.apache.lucene.search.TopDocs searchProductsWithinCategory(SearchList searchList) throws Exception
      Throws:
      Exception
    • searchProductsWithinManufacturer

      protected org.apache.lucene.search.TopDocs searchProductsWithinManufacturer(SearchList searchList) throws Exception
      Throws:
      Exception
    • searchProductsForProductList

      protected org.apache.lucene.search.TopDocs searchProductsForProductList(SearchList searchList) throws Exception
      Throws:
      Exception
    • searchCategories

      protected org.apache.lucene.search.TopDocs searchCategories(SearchList searchList) throws Exception
      Throws:
      Exception
    • searchManufacturers

      protected org.apache.lucene.search.TopDocs searchManufacturers(SearchList searchList) throws Exception
      Throws:
      Exception
    • searchAllDocuments

      protected org.apache.lucene.search.TopDocs searchAllDocuments(SearchList searchList) throws Exception
      Throws:
      Exception
    • determineQueryForProductsWithinManufacturer

      protected org.apache.lucene.search.Query determineQueryForProductsWithinManufacturer(SearchList searchList) throws Exception
      Throws:
      Exception
    • determineQueryForProductsForProductList

      protected org.apache.lucene.search.Query determineQueryForProductsForProductList(SearchList searchList) throws Exception
      Throws:
      Exception
    • determineQueryForCategories

      protected org.apache.lucene.search.Query determineQueryForCategories(SearchList searchList) throws Exception
      Throws:
      Exception
    • determineQueryForManufacturers

      protected org.apache.lucene.search.Query determineQueryForManufacturers(SearchList searchList) throws Exception
      Throws:
      Exception
    • determineQueryForAllDocuments

      protected org.apache.lucene.search.Query determineQueryForAllDocuments(SearchList searchList) throws Exception
      Throws:
      Exception
    • searchCustom

      protected org.apache.lucene.search.TopDocs searchCustom(SearchList searchList) throws Exception
      Throws:
      Exception
    • determineQueryForProducts

      protected org.apache.lucene.search.Query determineQueryForProducts(SearchList searchList) throws Exception
      Throws:
      Exception
    • determineQueryForProductsWithinCategory

      protected org.apache.lucene.search.Query determineQueryForProductsWithinCategory(SearchList searchList) throws Exception
      Throws:
      Exception
    • determineSort

      protected org.apache.lucene.search.Sort determineSort(SearchList searchList)
    • createParserUsingDefaults

      protected org.apache.lucene.queryParser.QueryParser createParserUsingDefaults(SearchList searchList) throws Exception
      Throws:
      Exception
    • createParser

      protected org.apache.lucene.queryParser.QueryParser createParser(SearchList searchList, String field, org.apache.lucene.analysis.Analyzer analyzer, String advancedSearchMatchStyle, String advancedSearchFuzziness) throws Exception
      Throws:
      Exception
    • addDefaultOperatorToParser

      protected void addDefaultOperatorToParser(org.apache.lucene.queryParser.QueryParser parser, String advancedSearchMatchStyle)
    • addFuzzinessToParser

      protected void addFuzzinessToParser(org.apache.lucene.queryParser.QueryParser parser, String advancedSearchFuzziness)
    • addFuzzinessToSearchString

      protected String addFuzzinessToSearchString(String searchString, String advancedSearchMatchStyle)
    • addWildcardsToSearchString

      protected String addWildcardsToSearchString(String searchString, String advancedSearchMatchStyle)
    • appendToEachTermInSearchString

      protected String appendToEachTermInSearchString(String searchString, String toAppend)
    • addQuotesToSearchString

      protected String addQuotesToSearchString(String searchString, String advancedSearchMatchStyle)
    • isReservedTerm

      protected boolean isReservedTerm(String term)
    • parseSearchString

      protected org.apache.lucene.search.Query parseSearchString(org.apache.lucene.queryParser.QueryParser parser, String searchString) throws org.apache.lucene.queryParser.ParseException
      Throws:
      org.apache.lucene.queryParser.ParseException
    • performSearch

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

      protected org.apache.lucene.search.TopDocs performSearch(org.apache.lucene.search.Query mainQuery, int numberOfItems, org.apache.lucene.search.Sort sort, SearchList searchList) throws Exception
      Throws:
      Exception
    • createTopDocsCollector

      protected org.apache.lucene.search.TopDocsCollector createTopDocsCollector(org.apache.lucene.search.Sort sort) throws IOException
      Throws:
      IOException
    • loadSearchListFromDatabase

      protected SearchList loadSearchListFromDatabase(SearchList searchList, org.apache.lucene.search.TopDocs hits) throws Exception
      Throws:
      Exception
    • createHighlightedExcerpt

      protected String createHighlightedExcerpt(Object object, SearchList searchList)
    • createHighlighter

      protected org.apache.lucene.search.highlight.Highlighter createHighlighter(SearchList searchList)
    • searchForFacetCounts

      protected SearchList searchForFacetCounts(SearchList searchList) throws Exception
      Throws:
      Exception
    • searchFacetsForProducts

      protected Collection searchFacetsForProducts(SearchList searchList, org.apache.lucene.search.IndexSearcher searcher, LuceneFacetHelper lfh) throws Exception
      Throws:
      Exception
    • searchFacetsForProductsWithinCategory

      protected Collection searchFacetsForProductsWithinCategory(SearchList searchList, org.apache.lucene.search.IndexSearcher searcher, LuceneFacetHelper lfh) throws Exception
      Throws:
      Exception
    • searchFacetsForProductsWithinManufacturer

      protected Collection searchFacetsForProductsWithinManufacturer(SearchList searchList, org.apache.lucene.search.IndexSearcher searcher, LuceneFacetHelper lfh) throws Exception
      Throws:
      Exception
    • searchFacetsForProductsForProductList

      protected Collection searchFacetsForProductsForProductList(SearchList searchList, org.apache.lucene.search.IndexSearcher searcher, LuceneFacetHelper lfh) throws Exception
      Throws:
      Exception
    • searchFacetsForCategories

      protected Collection searchFacetsForCategories(SearchList searchList, org.apache.lucene.search.IndexSearcher searcher, LuceneFacetHelper lfh) throws Exception
      Throws:
      Exception
    • searchFacetsForManufacturers

      protected Collection searchFacetsForManufacturers(SearchList searchList, org.apache.lucene.search.IndexSearcher searcher, LuceneFacetHelper lfh) throws Exception
      Throws:
      Exception
    • searchFacetsForAllDocuments

      protected Collection searchFacetsForAllDocuments(SearchList searchList, org.apache.lucene.search.IndexSearcher searcher, LuceneFacetHelper lfh) throws Exception
      Throws:
      Exception
    • searchFacetsForCustom

      protected Collection searchFacetsForCustom(SearchList searchList, org.apache.lucene.search.IndexSearcher searcher, LuceneFacetHelper lfh) throws Exception
      Throws:
      Exception