Class SolrProductSearch


  • public abstract class SolrProductSearch
    extends java.lang.Object
    Base class for OFBiz Test Tools test case implementations.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
      static java.lang.String resource  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> addListToSolrIndex​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Adds a List of products to the solr index.
      static java.util.Map<java.lang.String,​java.lang.Object> addToSolr​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Adds product to solr, with product denoted by productId field in instance attribute - intended for use with ECAs/SECAs.
      static java.util.Map<java.lang.String,​java.lang.Object> addToSolrIndex​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Adds product to solr index.
      static java.util.Map<java.lang.String,​java.lang.Object> getAvailableCategories​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Returns a map of the categories currently available under the root element.
      static java.util.Map<java.lang.String,​java.lang.Object> getSideDeepCategories​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Return a map of the side deep categories.
      static java.util.Map<java.lang.String,​java.lang.Object> keywordSearch​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Performs keyword search.
      static java.util.Map<java.lang.String,​java.lang.Object> productsSearch​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Performs solr products search.
      static java.util.Map<java.lang.String,​java.lang.Object> rebuildSolrIndex​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Rebuilds the solr index.
      static java.util.Map<java.lang.String,​java.lang.Object> runSolrQuery​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Runs a query on the Solr Search Engine and returns the results.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Constructor Detail

      • SolrProductSearch

        public SolrProductSearch()
    • Method Detail

      • addToSolr

        public static java.util.Map<java.lang.String,​java.lang.Object> addToSolr​(DispatchContext dctx,
                                                                                       java.util.Map<java.lang.String,​java.lang.Object> context)
                                                                                throws GenericEntityException
        Adds product to solr, with product denoted by productId field in instance attribute - intended for use with ECAs/SECAs.
        Throws:
        GenericEntityException
      • addListToSolrIndex

        public static java.util.Map<java.lang.String,​java.lang.Object> addListToSolrIndex​(DispatchContext dctx,
                                                                                                java.util.Map<java.lang.String,​java.lang.Object> context)
                                                                                         throws GenericEntityException
        Adds a List of products to the solr index.

        This is faster than reflushing the index each time.

        Throws:
        GenericEntityException
      • runSolrQuery

        public static java.util.Map<java.lang.String,​java.lang.Object> runSolrQuery​(DispatchContext dctx,
                                                                                          java.util.Map<java.lang.String,​java.lang.Object> context)
        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

        public static java.util.Map<java.lang.String,​java.lang.Object> productsSearch​(DispatchContext dctx,
                                                                                            java.util.Map<java.lang.String,​java.lang.Object> context)
        Performs solr products search.
      • keywordSearch

        public static java.util.Map<java.lang.String,​java.lang.Object> keywordSearch​(DispatchContext dctx,
                                                                                           java.util.Map<java.lang.String,​java.lang.Object> context)
        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 java.util.Map<java.lang.String,​java.lang.Object> getAvailableCategories​(DispatchContext dctx,
                                                                                                    java.util.Map<java.lang.String,​java.lang.Object> context)
        Returns a map of the categories currently available under the root element.
      • getSideDeepCategories

        public static java.util.Map<java.lang.String,​java.lang.Object> getSideDeepCategories​(DispatchContext dctx,
                                                                                                   java.util.Map<java.lang.String,​java.lang.Object> context)
        Return a map of the side deep categories.