com.softslate.commerce.businessobjects.product
Class BasicLuceneIndexer
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.BasicLuceneIndexer
- All Implemented Interfaces:
- BusinessObject, BusinessProcessor, LuceneIndexer
public class BasicLuceneIndexer
- extends BaseLuceneProcessor
- implements LuceneIndexer
Class responsible for creating the Lucene index for advanced search
functionality.
- Author:
- Jason McWilliams, David Tobey
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor |
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getProductIDs, getSettings, getUser, initialize, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setSettings, setUser, 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.BusinessProcessor |
getAppComponents, getAppSettings, getBusinessObjectFactory, getDaoFactory, getSettings, getUser, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setSettings, setUser, utils |
log
static org.apache.commons.logging.Log log
doubleFormat
private static final java.text.DecimalFormat doubleFormat
newIndexSubdirectory
public static final java.lang.String newIndexSubdirectory
- See Also:
- Constant Field Values
oldIndexSubdirectory
public static final java.lang.String oldIndexSubdirectory
- See Also:
- Constant Field Values
indexWriter
private org.apache.lucene.index.IndexWriter indexWriter
BasicLuceneIndexer
public BasicLuceneIndexer()
getIndexWriter
public org.apache.lucene.index.IndexWriter getIndexWriter(boolean resetIndex)
throws java.lang.Exception
- Throws:
java.lang.Exception
reindex
public java.util.Map reindex(java.util.Map parameters)
throws java.lang.Exception
- Specified by:
reindex
in interface LuceneIndexer
- Throws:
java.lang.Exception
addAllProducts
public java.util.Map addAllProducts(org.apache.lucene.index.IndexWriter writer)
throws java.lang.Exception
- Throws:
java.lang.Exception
addEditProduct
public java.util.Map addEditProduct(int productID)
throws java.lang.Exception
- Throws:
java.lang.Exception
deleteProduct
public boolean deleteProduct(int productID)
throws java.lang.Exception
- Throws:
java.lang.Exception
indexProduct
public org.apache.lucene.document.Document indexProduct(Product product)
throws java.lang.Exception
- Throws:
java.lang.Exception
addAllCategories
public java.util.Map addAllCategories(org.apache.lucene.index.IndexWriter writer)
throws java.lang.Exception
- Throws:
java.lang.Exception
addEditCategory
public java.util.Map addEditCategory(int categoryID)
throws java.lang.Exception
- Throws:
java.lang.Exception
deleteCategory
public boolean deleteCategory(int categoryID)
throws java.lang.Exception
- Throws:
java.lang.Exception
indexCategory
public org.apache.lucene.document.Document indexCategory(Category category)
throws java.lang.Exception
- Throws:
java.lang.Exception
addAllManufacturers
public java.util.Map addAllManufacturers(org.apache.lucene.index.IndexWriter writer)
throws java.lang.Exception
- Throws:
java.lang.Exception
addEditManufacturer
public java.util.Map addEditManufacturer(int manufacturerID)
throws java.lang.Exception
- Throws:
java.lang.Exception
deleteManufacturer
public boolean deleteManufacturer(int manufacturerID)
throws java.lang.Exception
- Throws:
java.lang.Exception
indexManufacturer
public org.apache.lucene.document.Document indexManufacturer(Manufacturer manufacturer)
throws java.lang.Exception
- Throws:
java.lang.Exception
addStringFields
public void addStringFields(org.apache.lucene.document.Document doc,
java.lang.Object object,
java.lang.StringBuffer contentBuffer)
throws java.lang.Exception
- Specified by:
addStringFields
in interface LuceneIndexer
- Throws:
java.lang.Exception
getTermHitCount
public int getTermHitCount(java.lang.String fieldName,
java.lang.String searchString)
throws java.lang.Exception
- Throws:
java.lang.Exception
textFormat
public java.lang.String textFormat(java.lang.Object i)
throws java.lang.Exception
- Throws:
java.lang.Exception
pad
public static java.lang.String pad(java.lang.Double d)
pad
public static java.lang.String pad(int i)
copyNewIndexFilesIntoPlace
public void copyNewIndexFilesIntoPlace()
throws ApplicationException
- Throws:
ApplicationException
Copyright © SoftSlate, LLC 20032005