Class BasicLuceneFacetHelper
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.BasicLuceneFacetHelper
- All Implemented Interfaces:
BusinessObject
,BusinessProcessor
,LuceneFacetHelper
Class responsible for searching on the Lucene index for facets.
- Author:
- David Tobey
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic char
(package private) static org.apache.commons.logging.Log
Fields inherited from class com.softslate.commerce.businessobjects.product.BaseLuceneProcessor
facetIndexDir, indexDir, suggestionsIndexDir
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map
compileIncomingFacetsAsMap
(String[] facets) org.apache.lucene.search.BooleanQuery
createFacetsBooleanQuery
(String[] facets) org.apache.lucene.facet.search.FacetsCollector
createFacetsCollector
(SearchList searchList) private String
protected Map
loadFacetCategories
(Collection facetResultCollection, Map categoryMap) protected Map
loadFacetCategories
(org.apache.lucene.facet.search.results.FacetResultNode frn, Map facetCategories, Map categoryMap) loadFacetCategoriesAndManufacturers
(SearchList searchList) loadFacetManufacturersFromDatabase
(Collection facetResultCollection) void
logFacetResults
(Collection facetResultCollection) performFacetSearch
(org.apache.lucene.search.Query query, SearchList searchList, org.apache.lucene.search.IndexSearcher searcher) protected Map
simplifyFacetResultNode
(org.apache.lucene.facet.search.results.FacetResultNode frn) protected Map
simplifyFacetResultNodeAsMap
(org.apache.lucene.facet.search.results.FacetResultNode frn) simplifyFacetResults
(Collection facetResults) simplifyFacetResultsAsMap
(Collection facetResults) protected Collection
simplifyFacetSubResults
(Iterable facetSubResults) protected Map
simplifyFacetSubResultsAsMap
(Iterable facetSubResults) protected String
sortByNaturalMatchedFromSetting
(String facetGroupName) protected String
sortByNumericMatchedFromSetting
(String facetGroupName) protected void
sortFacets
(String facetName, Collection subResults) 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 -
FACET_SEPARATOR
public static char FACET_SEPARATOR
-
-
Constructor Details
-
BasicLuceneFacetHelper
public BasicLuceneFacetHelper()
-
-
Method Details
-
performFacetSearch
public Collection performFacetSearch(org.apache.lucene.search.Query query, SearchList searchList, org.apache.lucene.search.IndexSearcher searcher) throws Exception - Specified by:
performFacetSearch
in interfaceLuceneFacetHelper
- Throws:
Exception
-
simplifyFacetResults
- Specified by:
simplifyFacetResults
in interfaceLuceneFacetHelper
-
simplifyFacetResultNode
-
sortFacets
-
sortByNumericMatchedFromSetting
-
sortByNaturalMatchedFromSetting
-
simplifyFacetSubResults
-
simplifyFacetResultsAsMap
- Specified by:
simplifyFacetResultsAsMap
in interfaceLuceneFacetHelper
-
simplifyFacetResultNodeAsMap
protected Map simplifyFacetResultNodeAsMap(org.apache.lucene.facet.search.results.FacetResultNode frn) -
simplifyFacetSubResultsAsMap
-
createFacetsBooleanQuery
- Specified by:
createFacetsBooleanQuery
in interfaceLuceneFacetHelper
-
compileIncomingFacetsAsMap
-
createFacetsCollector
public org.apache.lucene.facet.search.FacetsCollector createFacetsCollector(SearchList searchList) throws Exception - Specified by:
createFacetsCollector
in interfaceLuceneFacetHelper
- Throws:
Exception
-
loadFacetCategoriesAndManufacturers
- Specified by:
loadFacetCategoriesAndManufacturers
in interfaceLuceneFacetHelper
- Throws:
Exception
-
loadFacetCategories
protected Map loadFacetCategories(Collection facetResultCollection, Map categoryMap) throws Exception - Throws:
Exception
-
loadFacetCategories
protected Map loadFacetCategories(org.apache.lucene.facet.search.results.FacetResultNode frn, Map facetCategories, Map categoryMap) throws Exception - Throws:
Exception
-
loadFacetManufacturersFromDatabase
- Specified by:
loadFacetManufacturersFromDatabase
in interfaceLuceneFacetHelper
- Throws:
Exception
-
logFacetResults
- Specified by:
logFacetResults
in interfaceLuceneFacetHelper
-
escapeXML
-