com.softslate.commerce.businessobjects.product
Class BasicLuceneProcessor

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.BasicLuceneProcessor
All Implemented Interfaces:
BusinessObject, BusinessProcessor, LuceneProcessor

public class BasicLuceneProcessor
extends BaseBusinessProcessor
implements LuceneProcessor

Author:
Jason McWilliams

Field Summary
private static java.text.DecimalFormat doubleFormat
           
private  java.io.File indexDir
           
private  org.apache.lucene.search.IndexSearcher indexSearcher
           
private  org.apache.lucene.index.IndexWriter indexWriter
           
(package private) static org.apache.commons.logging.Log log
           
 
Constructor Summary
BasicLuceneProcessor()
           
 
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)
           
 void addCategory(Category category, 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 addManufacturer(Manufacturer manufacturer, org.apache.lucene.index.IndexWriter writer)
           
 void addProduct(Product product, org.apache.lucene.index.IndexWriter writer)
           
 void addStringFields(org.apache.lucene.document.Document doc, java.lang.Object object, java.lang.StringBuffer contentBuffer)
           
 boolean deleteCategory(int categoryID)
           
 boolean deleteManufacturer(int manufacturerID)
           
 boolean deleteProduct(int productID)
           
 java.io.File getIndexDir()
           
 org.apache.lucene.search.IndexSearcher getIndexSearcher()
           
 org.apache.lucene.index.IndexWriter getIndexWriter(boolean resetIndex)
           
 SearchList getSearchList(SearchList searchList)
           
 int getTermHitCount(java.lang.String fieldName, java.lang.String searchString)
           
 void initIndexDir(java.lang.String indexParam)
           
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.util.Collection search(java.util.Map parameters)
           
 void setIndexDir(java.io.File indexDir)
           
 void setIndexSearcher(org.apache.lucene.search.IndexSearcher indexSearcher)
           
 java.lang.String textFormat(java.lang.Object i)
           
 
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, 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
 

Field Detail

log

static org.apache.commons.logging.Log log

doubleFormat

private static final java.text.DecimalFormat doubleFormat

indexDir

private java.io.File indexDir

indexWriter

private org.apache.lucene.index.IndexWriter indexWriter

indexSearcher

private org.apache.lucene.search.IndexSearcher indexSearcher
Constructor Detail

BasicLuceneProcessor

public BasicLuceneProcessor()
Method Detail

pad

public static java.lang.String pad(java.lang.Double d)

pad

public static java.lang.String pad(int i)

getIndexDir

public java.io.File getIndexDir()

setIndexDir

public void setIndexDir(java.io.File indexDir)

initIndexDir

public void initIndexDir(java.lang.String indexParam)

getIndexWriter

public org.apache.lucene.index.IndexWriter getIndexWriter(boolean resetIndex)
                                                   throws java.lang.Exception
Throws:
java.lang.Exception

getIndexSearcher

public org.apache.lucene.search.IndexSearcher getIndexSearcher()
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

setIndexSearcher

public void setIndexSearcher(org.apache.lucene.search.IndexSearcher indexSearcher)

search

public java.util.Collection search(java.util.Map parameters)
                            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 LuceneProcessor
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

addProduct

public void addProduct(Product product,
                       org.apache.lucene.index.IndexWriter writer)
                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

addCategory

public void addCategory(Category category,
                        org.apache.lucene.index.IndexWriter writer)
                 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

addManufacturer

public void addManufacturer(Manufacturer manufacturer,
                            org.apache.lucene.index.IndexWriter writer)
                     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
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

getSearchList

public SearchList getSearchList(SearchList searchList)
                         throws java.lang.Exception
Specified by:
getSearchList in interface LuceneProcessor
Throws:
java.lang.Exception


Copyright ? SoftSlate, LLC 2003?2005