5 Replies Latest reply: Dec 21, 2012 3:45 AM by Michael Peel-Oracle RSS

    Multi sorting including aggregated products

    PradeepKPathak
      I have a requirement where I need to apply multi level sort for High-to-Low sorted price which is rolled up.
      I would also like to apply sorting for aggregated products in the same query to get final result.

      Ex: Ns=P_Price|1 --- does high to low sorting.
      Rolled up query looks like: Nu=P_Product&Ns=P_Price|1

      I need to push aggregated lowest price product as representative record in the same query as:
      Nu=P_Product&Ns=P_Price|1||P_Price|0

      Which should return me result based on lowest price product order as representative record for high-to-low sorted order.

      I am not sure whether any OOTB support to apply sorting at aggregated level in multi level sorting.
      If yes, I would like to know correct syntax.

      Thanks
      Pradeep
        • 1. Re: Multi sorting including aggregated products
          Michael Peel-Oracle
          I believe that sorting gets applied first, then rollup, and this means you can't sort by a number in one direction then try and sub-sort by the same number. Couple of options:
          1) If you only need the lowest price for the product (for displaying "From £x"), just use a derived property with the MIN function and the sku price property
          2) If you really need the representative record to be the lowest price sku, add two new properties to all records of P_Product_Price_Minimum and P_Product_Price_Maximum, then sort by P_Product_Price_Maximum|1||P_Price|0

          Michael
          • 2. Re: Multi sorting including aggregated products
            PradeepKPathak
            Thanks Michael for the approach.
            1) This approach is fine but I can't get products sorted in proper order. The highest price aggergated result can qualify second postion for a product whereas it holds good 10th postion because from price qualify for that (lowest sku price).

            2) It might not work when I filter at price level or apply other filter which has got mid price neither lowest, nor highest.

            Thanks
            Pradeep K Pathak
            • 3. Re: Multi sorting including aggregated products
              Michael Peel-Oracle
              Hi Pradeep
              977995 wrote:
              Thanks Michael for the approach.
              1) This approach is fine but I can't get products sorted in proper order. The highest price aggergated result can qualify second postion for a product whereas it holds good 10th postion because from price qualify for that (lowest sku price).
              Ah right, you don't want the products to be sorted by highest to lowest sku price, you want them sorted by highest to lowest minimum sku price per product. Not possible out of the box I'm afraid - you'd need to be able to sort by derived properties, and that isn't possible.

              I'd recommend checking the requirement with the business, as the majority of clients want the minimum price for the product as a whole (regardless of navigation filters) to be used for the "From £x" label. The business reason for this is that when the customer views a product detail page, they see all options regardless of the navigation state of the previous result list. If the From £x price changes from one value in the navigation results to a completely different value on the product detail page, you create an inconsistent and confusing user experience.

              Your only other alternatives (that I can think of off the top of my head) are to use an analytics query or to return all skus, and both of those are going to result in performance degradation (the latter especially given your network traffic) that might not be worth it given this is an infrequent issue with a rarely used sort order.

              >
              Thanks
              Pradeep K Pathak
              Michael
              • 4. Re: Multi sorting including aggregated products
                Pradeep Pathak
                Thanks Michael.
                The Business concern here is to move "from price" product to the right place (means few position down) where I can visualise products are sorted in a correct order for High to Low sorting option. This concern very much apply for multi seller products where after filtering seller facet make sense to display seller price.

                Thanks
                Pradeep K Pathak
                • 5. Re: Multi sorting including aggregated products
                  Michael Peel-Oracle
                  Analytics or return all ERecs (Np=2 / ENEQuery.setNavERecsPerAggrERec(2) / ENEQuery.NavERecsPerAggrERec=2) it is then. Just make sure you only do this when Price High to Low sorting is set.

                  Michael