Friday, May 8, 2020

Does Endeca Experience Manager Results List support multiple Boost and Bury conditions?

Endeca Results List cartridge displays search and navigation results to site users. You can configure it to boost or bury selected records ... thumbnail 1 summary
Endeca Results List cartridge displays search and navigation results to site users. You can configure it to boost or bury selected records using experience manager.

Suppose Business wants to Boost all record based on following criteria

  1. Boost few records based on defined product id key
  2. Show all records within price range between 10-25$ with sale products first
  3. Show all records within price range between 10-25$ with Clearance Products after rule 1
  4. Remaining records

Endeca OOTB functionality allow business to select only one condition to select boost/bury records in Results List Cartridge. Results list Boost and Bury editor does not allow to put all above four rules to display records out of the box.

We can leverage the Results list cartridge and customize to support multiple boost and bury condition. Stratify module is used as part of sorting parameter in ENE query to support boost/bury algorithm. 

Here is how custom cartridge would look like  Endeca Results List Multiple Boost and Bury Editor Customization


Here is code snippet that needs to used in ResultsList Handler to capture Boost list

for(XmlContentItem contentItem : contentItems){       
          if(contentItem!=null){
            List<CollectionFilter> collectionFilters = (List<CollectionFilter>)contentItem.get("boostStrata");
                if (collectionFilters != null)
                {
                  List<String> listFIlters = new ArrayList<>();
                  boolean propFilterStatus = false;
                  for (Filter boostFilter : collectionFilters)
                   {
                    buf.append(EQLUtil.toEQLString(boostFilter));
                    buf.append(",");
                    if(boostFilter instanceof CollectionFilter){
                      CollectionFilter collectionFilter = (CollectionFilter)boostFilter;
                      Filter innerFilter = collectionFilter.getInnerFilter();
                       if(innerFilter instanceof PropertyFilter){
                        PropertyFilter propFilter = (PropertyFilter)innerFilter;
                        listFIlters.add(propFilter.getName()+":"+propFilter.getValue());
                        propFilterStatus = true;
                       }
                     
                       if(innerFilter instanceof AndFilter){
                         AndFilter andFilter = (AndFilter)innerFilter;
                        List<Filter> operands =  andFilter.getOperands();
                        for(Filter filter : operands){
                           if(filter instanceof DimensionFilter){
                             DimensionFilter dimFIlter = (DimensionFilter)filter;
                             listFIlters.add(dimFIlter.getDvalId());
                           }
                        }
                         
                      }
                    }
                 }

Same logic needs to be calculated for bury Strata as well and needs to append along with Ns Parameter in the Endeca query to support multiple boost and bury scenario.



No comments

Post a Comment

Note: Only a member of this blog may post a comment.

Text Widget