|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.konakart.bl.BaseMgr
com.konakart.bl.SolrMgr
public class SolrMgr
Manager for code to interface with Solr
| Nested Class Summary | |
|---|---|
protected class |
SolrMgr.StaticData
Used to store the static data of this manager |
| Field Summary | |
|---|---|
protected static java.lang.String |
AND
Values used in Query |
protected static java.lang.String |
CLOSE_BRACKETS
|
protected static java.lang.String |
COLON
|
protected static org.apache.commons.logging.Log |
log
the log |
protected static java.lang.String |
LUCENE_ESCAPE_CHARS
Lucene constants |
protected static java.util.regex.Pattern |
LUCENE_PATTERN
|
protected static java.lang.String |
mutex
|
protected static java.lang.String |
OPEN_BRACKETS
|
protected static java.lang.String |
OR
|
protected static java.lang.String |
POST_ENCODING
|
protected static int |
QUERY_SELECT
Type of Query |
protected static int |
QUERY_TERM
|
protected static java.lang.String |
REPLACEMENT_STRING
|
protected static java.util.Map<java.lang.String,SolrMgr.StaticData> |
staticDataHM
Hash Map that contains the static data |
protected static java.lang.String |
TO
|
| Fields inherited from class com.konakart.bl.BaseMgr |
|---|
templateBaseDir |
| Constructor Summary | |
|---|---|
SolrMgr(KKEngIf eng)
Constructor |
|
| Method Summary | |
|---|---|
protected java.lang.String |
beforeSendQuery(java.lang.String sessionId,
java.lang.String queryString,
DataDescriptorIf dataDesc,
ProductSearchIf prodSearch,
int languageId)
Method that can be used to customize the query string. |
protected java.lang.String |
escapeSearchString(java.lang.String searchString)
The Lucene search engine requires the following characters to be escaped: + - ! ( ) { } [ ] ^ " ~ * ? : \ |
protected java.lang.String |
getCustomSearchString(java.math.BigDecimal searchDec,
int rule,
int customFieldNum)
Creates a search string based on the rule. |
protected java.lang.String |
getCustomSearchString(java.lang.Integer searchInt,
int rule,
int customFieldNum)
Creates a search string based on the rule. |
protected java.lang.String |
getCustomSearchString(java.lang.String searchString,
int rule,
int customFieldNum)
Creates a search string based on the rule. |
protected java.net.URL |
getSolrSelectUrl(java.lang.String cmd,
int type)
Get the Solr Url For selecting data |
protected java.net.URL |
getSolrUpdateUrl()
Get the Solr Url For updating data |
SuggestedSearchItem[] |
getSuggestedSearchItems(java.lang.String sessionId,
SuggestedSearchOptionsIf options)
Method that uses SOLR Terms in order to get suggested search data based on a search string. |
protected java.lang.String |
getTextSearchString(java.lang.String searchString,
int rule)
Creates a search string based on the rule. |
void |
refreshConfigs()
Get the config variables needed to setup the Solr mgr |
void |
removeProductFromSearchEngine(int productId)
Remove a single product referenced by productId from the Solr search engine |
SolrProducts |
searchForProducts(java.lang.String sessionId,
DataDescriptorIf dataDesc,
ProductSearchIf prodSearch,
int priceId,
int languageId)
This method only gets called if the Solr search engine is activated and if the prodSearch contains some text. |
protected java.lang.String |
sendQueryToSolr(java.lang.String query,
int type)
|
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.util.Map<java.lang.String,SolrMgr.StaticData> staticDataHM
protected static final int QUERY_SELECT
protected static final int QUERY_TERM
protected static final java.lang.String AND
protected static final java.lang.String OR
protected static final java.lang.String TO
protected static final java.lang.String COLON
protected static final java.lang.String OPEN_BRACKETS
protected static final java.lang.String CLOSE_BRACKETS
protected static final java.lang.String POST_ENCODING
protected static final java.lang.String LUCENE_ESCAPE_CHARS
protected static final java.util.regex.Pattern LUCENE_PATTERN
protected static final java.lang.String REPLACEMENT_STRING
protected static java.lang.String mutex
| Constructor Detail |
|---|
public SolrMgr(KKEngIf eng)
throws java.lang.Exception
eng -
java.lang.Exception| Method Detail |
|---|
public SuggestedSearchItem[] getSuggestedSearchItems(java.lang.String sessionId,
SuggestedSearchOptionsIf options)
throws java.lang.Exception
getSuggestedSearchItems in interface SolrMgrIfsessionId - options -
KKException
java.lang.Exception
public SolrProducts searchForProducts(java.lang.String sessionId,
DataDescriptorIf dataDesc,
ProductSearchIf prodSearch,
int priceId,
int languageId)
throws java.lang.Exception
searchForProducts in interface SolrMgrIfsessionId - dataDesc - prodSearch - priceId - languageId -
java.lang.Exception
protected java.lang.String beforeSendQuery(java.lang.String sessionId,
java.lang.String queryString,
DataDescriptorIf dataDesc,
ProductSearchIf prodSearch,
int languageId)
throws java.lang.Exception
sessionId - The sessionId of the logged in userqueryString - Query string that will be sent to SOLRdataDesc - DataDescriptor objectprodSearch - ProductSearch object which may be nulllanguageId - Language id
java.lang.Exception
protected java.lang.String sendQueryToSolr(java.lang.String query,
int type)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException,
java.lang.Exception
query - The parameters for the HTTP GETtype - The type of query
java.lang.Exception
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
public void removeProductFromSearchEngine(int productId)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException,
java.lang.Exception
removeProductFromSearchEngine in interface SolrMgrIfproductId -
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
protected java.net.URL getSolrSelectUrl(java.lang.String cmd,
int type)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException,
java.lang.Exception
cmd - type - The type of query
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
protected java.net.URL getSolrUpdateUrl()
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 SolrMgrIfjava.lang.Exception
public boolean useSolr()
throws KKException
useSolr in interface SolrMgrIfKKException
protected java.lang.String getTextSearchString(java.lang.String searchString,
int rule)
searchString - rule -
protected java.lang.String getCustomSearchString(java.lang.String searchString,
int rule,
int customFieldNum)
searchString - The search stringrule - The rule for determining whether to introduce a wild cardcustomFieldNum - Used to detect which custom field is being used
protected java.lang.String getCustomSearchString(java.lang.Integer searchInt,
int rule,
int customFieldNum)
searchInt - The search integerrule - The rule for determining whether to introduce less than, greater than etc.customFieldNum - Used to detect which custom field is being used
protected java.lang.String getCustomSearchString(java.math.BigDecimal searchDec,
int rule,
int customFieldNum)
searchDec - The search Big Decimalrule - The rule for determining whether to introduce less than, greater than etc.customFieldNum - Used to detect which custom field is being used
protected java.lang.String escapeSearchString(java.lang.String searchString)
searchString -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||