Sort dimension descending using config

  1. Home
  2. Blog
  3. Sort dimension descending using config

Sort dimension descending using config

Problem:

An alpha-numeric property in Endeca, need to be configured to sort in descending, can we do this using developer studio?
For example, we have “Year” dimension and it showing in below format and we want to to set it in descending order from 2016 -1950

Year
  1950
  1951
  1952
  1953
  1954
  1955
  1956
  1957
  1958
  1959
  1960
  1961
  1962
  1963
  1964
  1965
  1966
  1967
  1968
  1969
  1970
  1971
  1972
  1973
  1974
  1975
  1976
  1977
  1978
  1979
  1980
  1981
  1982
  1983
  1984
  1985
  1986
  1987
  1988
  1989
  1990
  1991
  1992
  1993
  1994
  1995
  1996
  1997
  1998
  1999
  2000
  2001
  2002
  2003
  2004
  2005
  2006
  2007
  2008
  2009
  2010
  2011
  2012
  2013
  2014
  2015
  2016

Solution:

Just add “SORT_ORDER=”DESC”” to dimension in “<app-name>.refinement_config.xml”  and run the baseline.

Please Note: If you have made any changes to the pipeline in developer studio, you have to add below changes gain.

<REFINEMENTS NAME="Year" SORT_TYPE="NUMERIC" SORT_ORDER="DESC">
<STATS NUM_RECORDS="FALSE"/>
</REFINEMENTS>

Output:

Year
  2016
  2015
  2014
  2013
  2012
  2011
  2010
  2009
  2008
  2007
  2006
  2005
  2004
  2003
  2002
  2001
  2000
  1999
  1998
  1997
  1996
  1995
  1994
  1993
  1992
  1991
  1990
  1989
  1988
  1987
  1986
  1985
  1984
  1983
  1982
  1981
  1980
  1979
  1978
  1977
  1976
  1975
  1974
  1973
  1972
  1971
  1970
  1969
  1968
  1967
  1966
  1965
  1964
  1963
  1962
  1961
  1960
  1959
  1958
  1957
  1956
  1955
  1954
  1953
  1952
  1951
  1950

 

Let's Share
Show Buttons
Hide Buttons