|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.bl.AdminBaseMgr
com.konakartadmin.bl.AdminSolrMgr
public class AdminSolrMgr
The AdminSolrMgr - for Managing the interface to the SOLR search server
Nested Class Summary | |
---|---|
protected class |
AdminSolrMgr.StaticData
Used to store the static data of this manager |
Field Summary | |
---|---|
protected static java.lang.String |
END
|
protected static org.apache.commons.logging.Log |
log
the log |
protected static java.lang.String |
MIDDLE
|
protected static java.lang.String |
mutex
|
protected static boolean |
PDFReaderPresent
|
protected static java.lang.String |
START
|
protected static java.util.Map<java.lang.String,AdminSolrMgr.StaticData> |
staticDataHM
Hash Map that contains the static data |
static int |
TT_CAT
static variable for term type |
static int |
TT_CAT_MANU
static variable for term type |
static int |
TT_MANU
static variable for term type |
static int |
TT_MANU_CAT
static variable for term type |
static int |
TT_MODEL
static variable for term type |
static int |
TT_NAME
static variable for term type |
protected static java.lang.String |
TYPE_PDF
|
protected static java.lang.String |
TYPE_TEXT
|
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir |
Constructor Summary | |
---|---|
AdminSolrMgr(KKAdminIf eng)
Constructor |
Method Summary | |
---|---|
void |
addAllProductsToSearchEngine(boolean async)
Loop through all of the products in the KonaKart database and add them to the Solr search engine. |
void |
addAllProductsToSearchEngineSync()
Loop through all of the products in the KonaKart database and add them to the Solr search engine |
void |
addProductToSearchEngine(int productId)
Add a single product referenced by productId to the Solr search engine |
void |
addProductToSearchEngine(int productId,
java.lang.String storeId)
Add a single product referenced by productId to the Solr search engine. |
protected void |
addTerm(int type,
java.lang.StringBuffer sb,
java.lang.String langCode,
java.lang.String term,
int prodId,
int catId,
int manuId,
java.lang.String storeId)
Common code to add a term for dynamic suggested searching |
private void |
checkPDFReaderPresent()
|
protected java.lang.String |
getAttachmentText(AdminProduct product)
Returns the text from the attachment so that it can be indexed in SOLR |
protected java.lang.StringBuffer |
getDocFromProduct(int productId,
java.lang.String storeId,
java.util.HashMap<java.lang.Integer,AdminLanguage> langMap)
Create an XML string from the product object that can be passed to Solr |
protected java.lang.String |
getFileType(java.lang.String filePath)
Returns the file extension |
protected java.util.HashMap<java.lang.Integer,AdminLanguage> |
getLangMap()
Returns a HashMap mapping language id to language |
int |
getSolrCommitFrequency()
The chunk size of records read from the database and written to SOLR after which a SOLR commit command is sent. |
protected java.net.URL |
getSolrUrl()
Get the Solr Url from a configuration variable |
protected void |
isEnabled()
Throws an exception if Solr isn't enabled. |
protected static boolean |
isPDFReaderPresent()
|
void |
refreshConfigs()
Refresh the configuration of the Admin Solr Manager |
void |
removeAllProductsFromSearchEngine(boolean async)
Remove all products from the Solr search engine. |
void |
removeAllProductsFromSearchEngineSync()
Remove all products from the Solr search engine |
void |
removeProductFromSearchEngine(int productId)
Remove a single product referenced by productId from the Solr search engine |
void |
removeProductFromSearchEngine(int productId,
java.lang.String storeId)
Remove a single product referenced by productId from the Solr search engine. |
protected static void |
setPDFReaderPresent(boolean readerPresent)
|
boolean |
useSolr()
Returns true if Solr can be used, otherwise it returns false |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected static java.lang.String mutex
protected static java.util.Map<java.lang.String,AdminSolrMgr.StaticData> staticDataHM
protected static final java.lang.String START
protected static final java.lang.String MIDDLE
protected static final java.lang.String END
protected static final java.lang.String TYPE_TEXT
protected static final java.lang.String TYPE_PDF
public static final int TT_CAT
public static final int TT_MANU
public static final int TT_CAT_MANU
public static final int TT_MANU_CAT
public static final int TT_NAME
public static final int TT_MODEL
protected static boolean PDFReaderPresent
Constructor Detail |
---|
public AdminSolrMgr(KKAdminIf eng) throws java.lang.Exception
eng
- the Admin Engine
java.lang.Exception
Method Detail |
---|
public void addAllProductsToSearchEngine(boolean async) throws java.lang.Exception
addAllProductsToSearchEngine
in interface AdminSolrMgrIf
async
- If true we do it asynchronously
java.lang.Exception
public void addAllProductsToSearchEngineSync() throws java.lang.Exception
addAllProductsToSearchEngineSync
in interface AdminSolrMgrIf
java.lang.Exception
public int getSolrCommitFrequency()
getSolrCommitFrequency
in interface AdminSolrMgrIf
public void removeAllProductsFromSearchEngine(boolean async) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
removeAllProductsFromSearchEngine
in interface AdminSolrMgrIf
async
- If true we do it asynchronously
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
public void removeAllProductsFromSearchEngineSync() throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
removeAllProductsFromSearchEngineSync
in interface AdminSolrMgrIf
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
public void removeProductFromSearchEngine(int productId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
removeProductFromSearchEngine
in interface AdminSolrMgrIf
productId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
public void removeProductFromSearchEngine(int productId, java.lang.String storeId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
removeProductFromSearchEngine
in interface AdminSolrMgrIf
productId
- storeId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
public void addProductToSearchEngine(int productId, java.lang.String storeId) throws java.lang.Exception
addProductToSearchEngine
in interface AdminSolrMgrIf
productId
- storeId
-
java.lang.Exception
public void addProductToSearchEngine(int productId) throws java.lang.Exception
addProductToSearchEngine
in interface AdminSolrMgrIf
productId
-
java.lang.Exception
protected java.util.HashMap<java.lang.Integer,AdminLanguage> getLangMap() throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException, java.lang.Exception
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
java.lang.Exception
protected java.lang.StringBuffer getDocFromProduct(int productId, java.lang.String storeId, java.util.HashMap<java.lang.Integer,AdminLanguage> langMap) throws java.lang.Exception
productId
- storeId
-
java.lang.Exception
protected void addTerm(int type, java.lang.StringBuffer sb, java.lang.String langCode, java.lang.String term, int prodId, int catId, int manuId, java.lang.String storeId) throws KKAdminException
type
- Used when specializing this method to decide whether to not include certain terms
in the search.sb
- langCode
- term
- prodId
- catId
- manuId
- storeId
-
KKAdminException
protected java.lang.String getAttachmentText(AdminProduct product) throws java.lang.Exception
product
-
java.lang.Exception
private void checkPDFReaderPresent() throws KKAdminException
KKAdminException
protected java.lang.String getFileType(java.lang.String filePath)
filePath
-
protected java.net.URL getSolrUrl() throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
public void refreshConfigs() throws java.lang.Exception
refreshConfigs
in interface AdminSolrMgrIf
refreshConfigs
in class AdminBaseMgr
java.lang.Exception
public boolean useSolr() throws java.lang.Exception
useSolr
in interface AdminSolrMgrIf
java.lang.Exception
com.konakart.app.KKException
protected void isEnabled() throws java.lang.Exception
com.konakart.app.KKException
java.lang.Exception
protected static boolean isPDFReaderPresent()
protected static void setPDFReaderPresent(boolean readerPresent)
readerPresent
- the pDFReaderPresent to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |