Package org.apache.ofbiz.solr
Class SolrProductSearch
java.lang.Object
org.apache.ofbiz.solr.SolrProductSearch
Base class for OFBiz Test Tools test case implementations.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddListToSolrIndex
(DispatchContext dctx, Map<String, Object> context) Adds a List of products to the solr index.addToSolr
(DispatchContext dctx, Map<String, Object> context) Adds product to solr, with product denoted by productId field in instance attribute - intended for use with ECAs/SECAs.addToSolrIndex
(DispatchContext dctx, Map<String, Object> context) Adds product to solr index.getAvailableCategories
(DispatchContext dctx, Map<String, Object> context) Returns a map of the categories currently available under the root element.getSideDeepCategories
(DispatchContext dctx, Map<String, Object> context) Return a map of the side deep categories.keywordSearch
(DispatchContext dctx, Map<String, Object> context) Performs keyword search.productsSearch
(DispatchContext dctx, Map<String, Object> context) Performs solr products search.rebuildSolrIndex
(DispatchContext dctx, Map<String, Object> context) Rebuilds the solr index.runSolrQuery
(DispatchContext dctx, Map<String, Object> context) Runs a query on the Solr Search Engine and returns the results.
-
Constructor Details
-
SolrProductSearch
public SolrProductSearch()
-
-
Method Details
-
addToSolr
public static Map<String,Object> addToSolr(DispatchContext dctx, Map<String, Object> context) throws GenericEntityExceptionAdds product to solr, with product denoted by productId field in instance attribute - intended for use with ECAs/SECAs.- Throws:
GenericEntityException
-
addToSolrIndex
public static Map<String,Object> addToSolrIndex(DispatchContext dctx, Map<String, Object> context) throws GenericEntityExceptionAdds product to solr index.- Throws:
GenericEntityException
-
addListToSolrIndex
public static Map<String,Object> addListToSolrIndex(DispatchContext dctx, Map<String, Object> context) throws GenericEntityExceptionAdds a List of products to the solr index.This is faster than reflushing the index each time.
- Throws:
GenericEntityException
-
runSolrQuery
Runs a query on the Solr Search Engine and returns the results.This function only returns an object of type QueryResponse, so it is probably not a good idea to call it directly from within the groovy files (As a decent example on how to use it, however, use keywordSearch instead).
-
productsSearch
Performs solr products search. -
keywordSearch
Performs keyword search.The search form requires the result to be in a specific layout, so this will generate the proper results.
-
getAvailableCategories
public static Map<String,Object> getAvailableCategories(DispatchContext dctx, Map<String, Object> context) Returns a map of the categories currently available under the root element. -
getSideDeepCategories
public static Map<String,Object> getSideDeepCategories(DispatchContext dctx, Map<String, Object> context) Return a map of the side deep categories. -
rebuildSolrIndex
public static Map<String,Object> rebuildSolrIndex(DispatchContext dctx, Map<String, Object> context) throws GenericEntityExceptionRebuilds the solr index.- Throws:
GenericEntityException
-