Class BasicLuceneSuggestionsSearcher
java.lang.Object
com.softslate.commerce.businessobjects.core.BaseBusinessObject
com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
com.softslate.commerce.businessobjects.product.BaseLuceneProcessor
com.softslate.commerce.businessobjects.product.BasicLuceneSearcher
com.softslate.commerce.businessobjects.product.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 Summary
FieldsFields inherited from class com.softslate.commerce.businessobjects.product.BaseLuceneProcessor
facetIndexDir, indexDir, suggestionsIndexDir
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
compileSuggestionsFromHits
(org.apache.lucene.search.TopDocs hits) protected org.apache.lucene.queryParser.QueryParser
createSuggestionsParser
(String searchString, String field, org.apache.lucene.analysis.Analyzer analyzer, String advancedSearchSuggestionsMatchStyle, String advancedSearchSuggestionsFuzziness) protected org.apache.lucene.queryParser.QueryParser
createSuggestionsParserUsingDefaults
(String searchString, String field, String advancedSearchSuggestionsMatchStyle, String advancedSearchSuggestionsFuzziness) protected org.apache.lucene.search.Query
determineSuggestionsQuery
(String searchString, String advancedSearchSuggestionsMatchStyle, String advancedSearchSuggestionsFuzziness) protected org.apache.lucene.search.Sort
protected String
makeSearchStringWildcardAndFuzzy
(String searchString, String advancedSearchSuggestionsMatchStyle, String advancedSearchSuggestionsFuzziness) protected org.apache.lucene.search.TopDocs
performSuggestionsSearch
(org.apache.lucene.search.Query mainQuery, int numberOfItems, org.apache.lucene.search.Sort sort) protected Collection
searchAndCompileSuggestions
(String searchString) protected org.apache.lucene.search.TopDocs
searchForSuggestionDocuments
(String searchString) searchSuggestions
(String indexDir, String searchString) Methods inherited from class com.softslate.commerce.businessobjects.product.BasicLuceneSearcher
addDefaultOperatorToParser, addFuzzinessToParser, addFuzzinessToSearchString, addQuotesToSearchString, addWildcardsToSearchString, appendToEachTermInSearchString, createHighlightedExcerpt, createHighlighter, createParser, createParserUsingDefaults, createTopDocsCollector, determineQueryForAllDocuments, determineQueryForCategories, determineQueryForManufacturers, determineQueryForProducts, determineQueryForProductsForProductList, determineQueryForProductsWithinCategory, determineQueryForProductsWithinManufacturer, determineSort, getFacetCounts, getSearchList, isReservedTerm, loadSearchListFromDatabase, parseSearchString, performSearch, performSearch, searchAllDocuments, searchCategories, searchCustom, searchFacetsForAllDocuments, searchFacetsForCategories, searchFacetsForCustom, searchFacetsForManufacturers, searchFacetsForProducts, searchFacetsForProductsForProductList, searchFacetsForProductsWithinCategory, searchFacetsForProductsWithinManufacturer, searchForDocuments, searchForFacetCounts, searchManufacturers, searchProducts, searchProductsForProductList, searchProductsWithinCategory, searchProductsWithinManufacturer
Methods inherited from class com.softslate.commerce.businessobjects.product.BaseLuceneProcessor
closeReaders, closeSuggestionsReader, copyNewIndexFilesIntoPlace, createAnalyzer, createSuggestionsAnalyzer, getFacetIndexDir, getFacetReader, getIndexDir, getIndexSearcher, getSuggestionsIndexDir, getSuggestionsSearcher, initFacetIndexDir, initIndexDir, initSuggestionsIndexDir, isFactedSearchEnabled, isSuggestionsEnabled, pad, pad, pruneArticlesFromName, restoreBackedUpIndexFiles, textFormat
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getProductIDs, getSettings, getUser, initialize, isProcessorClassActive, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPGet, sendHTTPPost, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, updateOrderTotals, updateOrderTotals, updateOrderTotals, utils
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessProcessor
getAppComponents, getAppSettings, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getSettings, getUser, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, utils
-
Field Details
-
log
static org.apache.commons.logging.Log log
-
-
Constructor Details
-
BasicLuceneSuggestionsSearcher
public BasicLuceneSuggestionsSearcher()
-
-
Method Details
-
searchSuggestions
- Specified by:
searchSuggestions
in interfaceLuceneSuggestionsSearcher
- Throws:
Exception
-
searchAndCompileSuggestions
- 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
-