6 Replies Latest reply: Aug 26, 2013 9:41 AM by 69910a52-7dd6-4067-9bf5-ddb9d83c7985 RSS

    Fetch and min and max value for a range dimension

    shabari

      Hi Everyone,

       

      Just want to know your inputs to proceed further for the below requirement.

       

      We have a property called price against each record that is indexed.

       

      In the front end application, we need to show PRICE dimension as a slider with min and max values derived from the result set.

       

      Example: Category Men has three products associated to it, each with $10, $20 and $30 respectively

      Category Women has three products associated to it, each with $10, $50 and $100 respectively.

       

      Now when the user selects Men category and see's the results, we should be showing PRICE dimension with MIN value as $10 and MAX value as $30.

      When the user is viewing Women category products, we should be showing PRICE dimension with MIN value as $10 and MAX value as $100.

       

      Does endeca return the min and max values of a particular property from the result set? Please advice.

       

      Thanks,

      Shabari

        • 1. Re: Fetch and min and max value for a range dimension
          Vijay89

          Hi Shabir,

           

          If i am not wrong about what you are looking for then:

           

          you can create range filter dimension in endeca. on which you can apply endeca queries to fetch records set with min/max/between values by using endeca range filter parameter Nf.

           

          say example:

          range filter dimension is : price

           

          you can fetch records whose price is greater than 10 as:

          N=0&Nf=price|GT+10

           

          you can fetch records whose price is less than 10 as:

          N=0&Nf=price|LT+10

           

          you can fetch records whose price is between than 10 and 20 as:

          N=0&Nf=price|BTWN+10+20

           

          you can refer to BasicDevGuid.pdf for more details on this.

           

          thanks,

          vijay

          • 2. Re: Fetch and min and max value for a range dimension
            Branchbird - Pat

            Adding an analytics statement to get min and max will accomplish this.  If you (or your customer) does not have an analytics license, you have other options like using a dimension that you never make available for navigation (and is always expanded) to get the values. 

             

            Could also get there by issuing a couple extra queries (for one record, sort by price descending and then the same with price ascending).

            • 3. Re: Fetch and min and max value for a range dimension
              SubrataG

              I'm not aware of Endeca returning min/ max value of a property or dimension. I would try to handle it in the front-end application by adding the price value of each record in a collection, and then sort the collection...grab the min and max value for display.

               

              Subrata

              • 4. Re: Fetch and min and max value for a range dimension
                Kaush-Endeca

                Subrata,

                 

                Adding logic to your front end to calculate min/max for a dimension may not work.  When you refine/navigate your results, some of the dimension values will become unavailable and therefore your calculation might not give you the real min and max.  It will only give you the min/max for that navigation state. You can ofcourse fire a separate query to get all the dimVals for your calculation but that can get hairy.  my 2 cents.

                 

                IHTH.

                 

                Best,

                Kaush

                • 5. Re: Fetch and min and max value for a range dimension
                  SubrataG

                  Hi Kaush,

                  I think the example in Shabari's post is trying to figure out the min/max for a specific navigation state...when a visitor selects the Men or Women category.

                   

                  Subrata

                  • 6. Re: Fetch and min and max value for a range dimension
                    69910a52-7dd6-4067-9bf5-ddb9d83c7985

                    Hi Shabari,

                     

                    BranchBird-Pat's solution would work for getting the exact min and max, but there would be some extra overhead from the multiple queries.

                     

                    Another option might be to approximate the min and max (assuming you want round numbers) by mapping products into "price bucket" dimensions ($5-$10,$10-$20,..) and using the price bucket refinements returned with the nav state to decide the slider min and max. This option won't give you the exact price, obviously, but it may fit your needs.