com.softslate.commerce.businessobjects.product
Class BasicLuceneIndexer

java.lang.Object
  extended by com.softslate.commerce.businessobjects.core.BaseBusinessObject
      extended by com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
          extended by com.softslate.commerce.businessobjects.product.BaseLuceneProcessor
              extended by 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

Field Summary
private static java.text.DecimalFormat doubleFormat
           
private  org.apache.lucene.index.IndexWriter indexWriter
           
(package private) static org.apache.commons.logging.Log log
           
static java.lang.String newIndexSubdirectory
           
static java.lang.String oldIndexSubdirectory
           
 
Constructor Summary
BasicLuceneIndexer()
           
 
Method Summary
 java.util.Map addAllCategories(org.apache.lucene.index.IndexWriter writer)
           
 java.util.Map addAllManufacturers(org.apache.lucene.index.IndexWriter writer)
           
 java.util.Map addAllProducts(org.apache.lucene.index.IndexWriter writer)
           
 java.util.Map addEditCategory(int categoryID)
           
 java.util.Map addEditManufacturer(int manufacturerID)
           
 java.util.Map addEditProduct(int productID)
           
 void addStringFields(org.apache.lucene.document.Document doc, java.lang.Object object, java.lang.StringBuffer contentBuffer)
           
 void copyNewIndexFilesIntoPlace()
           
 boolean deleteCategory(int categoryID)
           
 boolean deleteManufacturer(int manufacturerID)
           
 boolean deleteProduct(int productID)
           
 org.apache.lucene.index.IndexWriter getIndexWriter(boolean resetIndex)
           
 int getTermHitCount(java.lang.String fieldName, java.lang.String searchString)
           
 org.apache.lucene.document.Document indexCategory(Category category)
           
 org.apache.lucene.document.Document indexManufacturer(Manufacturer manufacturer)
           
 org.apache.lucene.document.Document indexProduct(Product product)
           
static java.lang.String pad(java.lang.Double d)
           
static java.lang.String pad(int i)
           
 java.util.Map reindex(java.util.Map parameters)
           
 java.lang.String textFormat(java.lang.Object i)
           
 
Methods inherited from class com.softslate.commerce.businessobjects.product.BaseLuceneProcessor
createAnalyzer, getIndexDir, getIndexSearcher, initIndexDir, setIndexDir, setIndexSearcher
 
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
 
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
 

Field Detail

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
Constructor Detail

BasicLuceneIndexer

public BasicLuceneIndexer()
Method Detail

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 2003–2005